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

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