Blame SOURCES/autofs-5.0.8-fix-symlink-expire.patch

4d476f
autofs-5.0.8 - fix symlink expire
4d476f
4d476f
From: Ian Kent <raven@themaw.net>
4d476f
4d476f
The expire code uses the list of mounts to decide if additional expire
4d476f
check requests should be sent to the kernel. This doesn't take into
4d476f
account the possibility there could be symlinks that might be able to
4d476f
be expired.
4d476f
4d476f
count_mounts() does count symlinks so use that only when working out
4d476f
how many expire requests should be sent.
4d476f
---
4d476f
 CHANGELOG         |    1 +
4d476f
 daemon/indirect.c |   22 ++++++++++------------
4d476f
 2 files changed, 11 insertions(+), 12 deletions(-)
4d476f
4d476f
--- autofs-5.0.7.orig/CHANGELOG
4d476f
+++ autofs-5.0.7/CHANGELOG
4d476f
@@ -86,6 +86,7 @@
4d476f
 - fix undefined authtype_requires_creds err if ldap enabled but without sasl.
4d476f
 - pass map_source as function paramter where possible.
4d476f
 - check for bind onto self in mount_bind.c.
4d476f
+- fix symlink expire.
4d476f
 
4d476f
 25/07/2012 autofs-5.0.7
4d476f
 =======================
4d476f
--- autofs-5.0.7.orig/daemon/indirect.c
4d476f
+++ autofs-5.0.7/daemon/indirect.c
4d476f
@@ -388,6 +388,7 @@ void *expire_proc_indirect(void *arg)
4d476f
 	struct expire_args ec;
4d476f
 	unsigned int now;
4d476f
 	int offsets, submnts, count;
4d476f
+	int retries;
4d476f
 	int ioctlfd, cur_state;
4d476f
 	int status, ret, left;
4d476f
 
4d476f
@@ -533,20 +534,17 @@ void *expire_proc_indirect(void *arg)
4d476f
 
4d476f
 	/*
4d476f
 	 * If there are no more real mounts left we could still
4d476f
-	 * have some offset mounts with no '/' offset so we need to
4d476f
-	 * umount them here.
4d476f
+	 * have some offset mounts with no '/' offset or symlinks
4d476f
+	 * so we need to umount or unlink them here.
4d476f
 	 */
4d476f
-	if (mnts) {
4d476f
-		int retries;
4d476f
-		pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
4d476f
-		retries = (count_mounts(ap->logopt, ap->path, ap->dev) + 1);
4d476f
-		while (retries--) {
4d476f
-			ret = ops->expire(ap->logopt, ap->ioctlfd, ap->path, now);
4d476f
-			if (ret)
4d476f
-				left++;
4d476f
-		}
4d476f
-		pthread_setcancelstate(cur_state, NULL);
4d476f
+	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
4d476f
+	retries = (count_mounts(ap->logopt, ap->path, ap->dev) + 1);
4d476f
+	while (retries--) {
4d476f
+		ret = ops->expire(ap->logopt, ap->ioctlfd, ap->path, now);
4d476f
+		if (ret)
4d476f
+			left++;
4d476f
 	}
4d476f
+	pthread_setcancelstate(cur_state, NULL);
4d476f
 	pthread_cleanup_pop(1);
4d476f
 
4d476f
 	count = offsets = submnts = 0;