]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mnt: Don't propagate umounts in __detach_mounts
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 24 Dec 2014 13:35:10 +0000 (07:35 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:01:53 +0000 (22:01 +0200)
commit14a2b31e96ebf7800cd71611d63d01a767229b8a
tree6ececb23ad630129f317f624a137fc2a60207a17
parent6910342c504d04e94b06d661b51afbae98331261
mnt: Don't propagate umounts in __detach_mounts

commit 8318e667f176f7ea34451a1a530634e293f216ac upstream.

Invoking mount propagation from __detach_mounts is inefficient and
wrong.

It is inefficient because __detach_mounts already walks the list of
mounts that where something needs to be done, and mount propagation
walks some subset of those mounts again.

It is actively wrong because if the dentry that is passed to
__detach_mounts is not part of the path to a mount that mount should
not be affected.

change_mnt_propagation(p,MS_PRIVATE) modifies the mount propagation
tree of a master mount so it's slaves are connected to another master
if possible.  Which means even removing a mount from the middle of a
mount tree with __detach_mounts will not deprive any mount propagated
mount events.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/namespace.c