• Eric W. Biederman's avatar
    mnt: Don't propagate umounts in __detach_mounts · 1c1cf82e
    Eric W. Biederman authored
    [ Upstream commit 8318e667 ]
    
    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.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
    Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
    1c1cf82e
namespace.c 78.3 KB