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

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