Blame SOURCES/autofs-5.0.9-amd-lookup-fix-amd-entry-not-found-at-expire.patch

306fa1
autofs-5.0.9 - fix amd entry not found at expire
306fa1
306fa1
From: Ian Kent <raven@themaw.net>
306fa1
306fa1
Due to the way amd matches keys in its map it's possible that
306fa1
distinct key entries aren't present in the map.
306fa1
306fa1
The indirect mount expire procedure needs to lookup cache entries
306fa1
for offset mounts in order to get the control file handle needed
306fa1
to send an expire check to them.
306fa1
306fa1
So we need to make sure that when a distinct match isn't found
306fa1
an expire check is still done. That's OK because the mounts in
306fa1
the expire list are under the autofs directory so they should
306fa1
be checked and the ap control file handle can be used for it.
306fa1
---
306fa1
 daemon/indirect.c |   12 +++++-------
306fa1
 1 file changed, 5 insertions(+), 7 deletions(-)
306fa1
306fa1
diff --git a/daemon/indirect.c b/daemon/indirect.c
306fa1
index 6dfbd25..a04a624 100644
306fa1
--- a/daemon/indirect.c
306fa1
+++ b/daemon/indirect.c
306fa1
@@ -513,15 +513,13 @@ void *expire_proc_indirect(void *arg)
306fa1
 		if (!me && ind_key)
306fa1
 			me = lookup_source_mapent(ap, ind_key, LKP_NORMAL);
306fa1
 		pthread_cleanup_pop(1);
306fa1
-		if (!me)
306fa1
-			continue;
306fa1
 
306fa1
-		if (*me->key == '/') {
306fa1
-			ioctlfd = me->ioctlfd;
306fa1
-		} else {
306fa1
-			ioctlfd = ap->ioctlfd;
306fa1
+		ioctlfd = ap->ioctlfd;
306fa1
+		if (me) {
306fa1
+			if (*me->key == '/')
306fa1
+				ioctlfd = me->ioctlfd;
306fa1
+			cache_unlock(me->mc);
306fa1
 		}
306fa1
-		cache_unlock(me->mc);
306fa1
 
306fa1
 		debug(ap->logopt, "expire %s", next->path);
306fa1