Skip to contentSkip to conversation

Patch "mnt: Add MNT_UMOUNT flag" has been added to the 4.0-stable tree

PATCH [email protected] 1 participant 1 message May 2, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

mnt: Add MNT_UMOUNT flag

to the 4.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
mnt-add-mnt_umount-flag.patch
and it can be found in the queue-4.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 590ce4bcbfb4e0462a720a4ad901e84416080bba Mon Sep 17 00:00:00 2001

From: "Eric W. Biederman" <[email protected]>
Date: Mon, 22 Dec 2014 18:30:08 -0600
Subject: mnt: Add MNT_UMOUNT flag

From: "Eric W. Biederman" <[email protected]>

commit 590ce4bcbfb4e0462a720a4ad901e84416080bba upstream.

In some instances it is necessary to know if the the unmounting process has begun on a mount. Add MNT_UMOUNT to make that reliably testable.

This fix gets used in fixing locked mounts in MNT_DETACH

---
 fs/namespace.c        |    4 +++-
 fs/pnode.c            |    1 +
 include/linux/mount.h |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)
fs/namespace.c +3 -1
@@ -1333,8 +1333,10 @@ static void umount_tree(struct mount *mn
 	struct mount *p;
 
 	/* Gather the mounts to umount */
-	for (p = mnt; p; p = next_mnt(p, mnt))
+	for (p = mnt; p; p = next_mnt(p, mnt)) {
+		p->mnt.mnt_flags |= MNT_UMOUNT;
 		list_move(&p->mnt_list, &tmp_list);
+	}
 
 	/* Hide the mounts from lookup_mnt and mnt_mounts */
 	list_for_each_entry(p, &tmp_list, mnt_list) {
fs/pnode.c +1 -0
@@ -384,6 +384,7 @@ static void __propagate_umount(struct mo
 		if (child && list_empty(&child->mnt_mounts)) {
 			list_del_init(&child->mnt_child);
 			hlist_del_init_rcu(&child->mnt_hash);
+			child->mnt.mnt_flags |= MNT_UMOUNT;
 			list_move_tail(&child->mnt_list, &mnt->mnt_list);
 		}
 	}
include/linux/mount.h +1 -0
@@ -61,6 +61,7 @@ struct mnt_namespace;
 #define MNT_DOOMED		0x1000000
 #define MNT_SYNC_UMOUNT		0x2000000
 #define MNT_MARKED		0x4000000
+#define MNT_UMOUNT		0x8000000
 
 struct vfsmount {
 	struct dentry *mnt_root;	/* root of the mounted tree */

Patches currently in stable-queue which might be from [email protected] are

queue-4.0/mnt-don-t-propagate-umounts-in-__detach_mounts.patch queue-4.0/mnt-add-mnt_umount-flag.patch queue-4.0/mnt-honor-mnt_locked-when-detaching-mounts.patch queue-4.0/mnt-delay-removal-from-the-mount-hash.patch queue-4.0/mnt-on-an-unmount-propagate-clearing-of-mnt_locked.patch queue-4.0/mnt-don-t-propagate-unmounts-to-locked-mounts.patch queue-4.0/mnt-factor-out-unhash_mnt-from-detach_mnt-and-umount_tree.patch queue-4.0/mnt-factor-umount_mnt-from-umount_tree.patch queue-4.0/mnt-fix-the-error-check-in-__detach_mounts.patch queue-4.0/mnt-update-detach_mounts-to-leave-mounts-connected.patch queue-4.0/mnt-improve-the-umount_tree-flags.patch queue-4.0/mnt-in-umount_tree-reuse-mnt_list-instead-of-mnt_hash.patch