Blame SOURCES/autofs-5.0.7-fix-submount-tree-not-all-expiring.patch

304803
autofs-5.0.7 - fix submount tree not all expiring
304803
304803
From: Ian Kent <ikent@redhat.com>
304803
304803
Due to the change in the expire-specific-submount-only patch, sub-mounts
304803
within an indirect mount that follow a submount (in the check order) won't
304803
be expired if that submount is busy.
304803
---
304803
 CHANGELOG    |    1 +
304803
 lib/master.c |   24 +++++++++++++++---------
304803
 2 files changed, 16 insertions(+), 9 deletions(-)
304803
304803
diff --git a/CHANGELOG b/CHANGELOG
304803
index f1ec1e5..4106e7f 100644
304803
--- a/CHANGELOG
304803
+++ b/CHANGELOG
304803
@@ -39,6 +39,7 @@
304803
 - document browse option in man page.
304803
 - fix some automount(8) typos.
304803
 - syncronize handle_mounts() shutdown.
304803
+- fix submount tree not all expiring.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
diff --git a/lib/master.c b/lib/master.c
304803
index a0e62f2..64dbcb1 100644
304803
--- a/lib/master.c
304803
+++ b/lib/master.c
304803
@@ -905,15 +905,24 @@ int master_notify_submount(struct autofs_point *ap, const char *path, enum state
304803
 		this = list_entry(p, struct autofs_point, mounts);
304803
 		p = p->prev;
304803
 
304803
-		if (!master_submount_list_empty(this)) {
304803
-			mounts_mutex_unlock(ap);
304803
-			return master_notify_submount(this, path, state);
304803
-		}
304803
-
304803
 		/* path not the same */
304803
 		if (strcmp(this->path, path))
304803
 			continue;
304803
 
304803
+		if (!master_submount_list_empty(this)) {
304803
+			char *this_path = strdup(this->path);
304803
+			if (this_path) {
304803
+				mounts_mutex_unlock(ap);
304803
+				master_notify_submount(this, path, state);
304803
+				mounts_mutex_lock(ap);
304803
+				if (!__master_find_submount(ap, this_path)) {
304803
+					free(this_path);
304803
+					continue;
304803
+				}
304803
+				free(this_path);
304803
+			}
304803
+		}
304803
+
304803
 		/* Now we have found the submount we want to expire */
304803
 
304803
 		st_mutex_lock();
304803
@@ -959,10 +968,7 @@ int master_notify_submount(struct autofs_point *ap, const char *path, enum state
304803
 			st_mutex_lock();
304803
 		}
304803
 		st_mutex_unlock();
304803
-		mounts_mutex_unlock(ap);
304803
-
304803
-		return ret;
304803
-
304803
+		break;
304803
 	}
304803
 
304803
 	mounts_mutex_unlock(ap);