forked from mirrors/linux
do_move_mount(): don't leak MNTNS_PROPAGATING on failures
as it is, a failed move_mount(2) from anon namespace breaks
all further propagation into that namespace, including normal
mounts in non-anon namespaces that would otherwise propagate
there.
Fixes: 064fe6e233 ("mount: handle mount propagation for detached mount trees")
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
65781e19dc
commit
267fc3a06a
1 changed files with 2 additions and 3 deletions
|
|
@ -3715,15 +3715,14 @@ static int do_move_mount(struct path *old_path,
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (is_anon_ns(ns))
|
|
||||||
ns->mntns_flags &= ~MNTNS_PROPAGATING;
|
|
||||||
|
|
||||||
/* if the mount is moved, it should no longer be expire
|
/* if the mount is moved, it should no longer be expire
|
||||||
* automatically */
|
* automatically */
|
||||||
list_del_init(&old->mnt_expire);
|
list_del_init(&old->mnt_expire);
|
||||||
if (attached)
|
if (attached)
|
||||||
put_mountpoint(old_mp);
|
put_mountpoint(old_mp);
|
||||||
out:
|
out:
|
||||||
|
if (is_anon_ns(ns))
|
||||||
|
ns->mntns_flags &= ~MNTNS_PROPAGATING;
|
||||||
unlock_mount(mp);
|
unlock_mount(mp);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
if (attached) {
|
if (attached) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue