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

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