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

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