diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2025-06-24 23:25:00 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2025-06-29 19:03:30 -0400 |
commit | ef86251194de9b31f7efcf70ea480ebe736e9e60 (patch) | |
tree | 484ff09df5e66c2b4887940b9ab122ea401dd851 /fs/pnode.c | |
parent | d5f15047f13b86b74d1ac4f39036ccae2078c492 (diff) |
change_mnt_propagation(): do_make_slave() is a no-op unless IS_MNT_SHARED()
... since mnt->mnt_share and mnt->mnt_slave_list are guaranteed to be empty unless
IS_MNT_SHARED(mnt).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/pnode.c')
-rw-r--r-- | fs/pnode.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/pnode.c b/fs/pnode.c index 14618eac2025..9723f05cda5f 100644 --- a/fs/pnode.c +++ b/fs/pnode.c @@ -70,10 +70,8 @@ static int do_make_slave(struct mount *mnt) struct mount *master, *slave_mnt; if (list_empty(&mnt->mnt_share)) { - if (IS_MNT_SHARED(mnt)) { - mnt_release_group_id(mnt); - CLEAR_MNT_SHARED(mnt); - } + mnt_release_group_id(mnt); + CLEAR_MNT_SHARED(mnt); master = mnt->mnt_master; if (!master) { struct list_head *p = &mnt->mnt_slave_list; @@ -119,7 +117,8 @@ void change_mnt_propagation(struct mount *mnt, int type) set_mnt_shared(mnt); return; } - do_make_slave(mnt); + if (IS_MNT_SHARED(mnt)) + do_make_slave(mnt); list_del_init(&mnt->mnt_slave); if (type == MS_SLAVE) { if (mnt->mnt_master) |