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

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