Patch "mnt: Update detach_mounts to leave mounts connected" has been added to the 4.0-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
mnt: Update detach_mounts to leave mounts connected
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-update-detach_mounts-to-leave-mounts-connected.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
e0c9c0afd2fc958ffa34b697972721d81df8a56fMon Sep 17 00:00:00 2001
From: "Eric W. Biederman" <[email protected]>
Date: Wed, 1 Apr 2015 18:30:06 -0500
Subject: mnt: Update detach_mounts to leave mounts connected
From: "Eric W. Biederman" <[email protected]>
commit e0c9c0afd2fc958ffa34b697972721d81df8a56f upstream.
Now that it is possible to lazily unmount an entire mount tree and leave the individual mounts connected to each other add a new flag UMOUNT_CONNECTED to umount_tree to force this behavior and use this flag in detach_mounts.
This closes a bug where the deletion of a file or directory could trigger an unmount and reveal data under a mount point.
--- fs/namespace.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
fs/namespace.c +6 -2
@@ -1350,6 +1350,7 @@ static inline void namespace_lock(void)enum umount_tree_flags {UMOUNT_SYNC =1 ,UMOUNT_PROPAGATE =2 , +UMOUNT_CONNECTED =4 , };/* * mount_lock must be held
@@ -1388,7 +1389,10 @@ static void umount_tree(struct mount *mnif (how &UMOUNT_SYNC ) p->mnt.mnt_flags |=MNT_SYNC_UMOUNT ; - disconnect = !IS_MNT_LOCKED_AND_LAZY (p); + disconnect = !(((how &UMOUNT_CONNECTED ) && +mnt_has_parent (p) && + (p->mnt_parent->mnt.mnt_flags &MNT_UMOUNT )) || +IS_MNT_LOCKED_AND_LAZY (p));pin_insert_group (&p->mnt_umount, &p->mnt_parent->mnt, disconnect ? &unmounted :NULL );
@@ -1531,7 +1535,7 @@ void __detach_mounts(struct dentry *dentumount_mnt (p); } } -else umount_tree (mnt,0 ); +else umount_tree (mnt,UMOUNT_CONNECTED ); }unlock_mount_hash ();put_mountpoint (mp);
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