Blame SOURCES/autofs-5.1.4-fix-incorrect-locking-in-sss-lookup.patch

306fa1
autofs-5.1.4 - fix incorrect locking in sss lookup
306fa1
306fa1
From: Ian Kent <raven@themaw.net>
306fa1
306fa1
Commit 766e0f6c4, autofs-5.0.7 - fix fix wildcard multi map regression,
306fa1
introduced a deadlock during restart when the sss modules is used.
306fa1
306fa1
Looking at the comment above the code which takes the lock it clearly
306fa1
does this incorrectly.
306fa1
306fa1
Signed-off-by: Ian Kent <raven@themaw.net>
306fa1
---
306fa1
 CHANGELOG            |    1 +
306fa1
 modules/lookup_sss.c |    4 ++--
306fa1
 2 files changed, 3 insertions(+), 2 deletions(-)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -310,6 +310,7 @@
306fa1
 - set bind mount as propagation slave.
306fa1
 - add master map pseudo options for mount propagation.
306fa1
 - fix amd parser opts option handling.
306fa1
+- fix incorrect locking in sss lookup.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/modules/lookup_sss.c
306fa1
+++ autofs-5.0.7/modules/lookup_sss.c
306fa1
@@ -786,9 +786,9 @@ int lookup_mount(struct autofs_point *ap
306fa1
 	 * when we're starting up so just take the readlock in that
306fa1
 	 */
306fa1
 	if (ap->flags & MOUNT_FLAG_REMOUNT)
306fa1
-		cache_writelock(mc);
306fa1
-	else
306fa1
 		cache_readlock(mc);
306fa1
+	else
306fa1
+		cache_writelock(mc);
306fa1
 	me = cache_lookup(mc, key);
306fa1
 	/* Stale mapent => check for entry in alternate source or wildcard */
306fa1
 	if (me && !me->mapent) {