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

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