Skip to content

Commit ef86251

Browse files
author
Al Viro
committed
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>
1 parent d5f1504 commit ef86251

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

fs/pnode.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ static int do_make_slave(struct mount *mnt)
7070
struct mount *master, *slave_mnt;
7171

7272
if (list_empty(&mnt->mnt_share)) {
73-
if (IS_MNT_SHARED(mnt)) {
74-
mnt_release_group_id(mnt);
75-
CLEAR_MNT_SHARED(mnt);
76-
}
73+
mnt_release_group_id(mnt);
74+
CLEAR_MNT_SHARED(mnt);
7775
master = mnt->mnt_master;
7876
if (!master) {
7977
struct list_head *p = &mnt->mnt_slave_list;
@@ -119,7 +117,8 @@ void change_mnt_propagation(struct mount *mnt, int type)
119117
set_mnt_shared(mnt);
120118
return;
121119
}
122-
do_make_slave(mnt);
120+
if (IS_MNT_SHARED(mnt))
121+
do_make_slave(mnt);
123122
list_del_init(&mnt->mnt_slave);
124123
if (type == MS_SLAVE) {
125124
if (mnt->mnt_master)

0 commit comments

Comments
 (0)