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

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