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

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