Skip to content

Commit dd5a4e1

Browse files
author
Al Viro
committed
change_mnt_propagation(): move ->mnt_master assignment into MS_SLAVE case
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 8c5a853 commit dd5a4e1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fs/pnode.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,14 @@ static void transfer_propagation(struct mount *mnt, struct mount *to)
104104
*/
105105
void change_mnt_propagation(struct mount *mnt, int type)
106106
{
107+
struct mount *m = mnt->mnt_master;
108+
107109
if (type == MS_SHARED) {
108110
set_mnt_shared(mnt);
109111
return;
110112
}
111113
if (IS_MNT_SHARED(mnt)) {
112-
struct mount *m = propagation_source(mnt);
113-
114+
m = propagation_source(mnt);
114115
if (list_empty(&mnt->mnt_share)) {
115116
mnt_release_group_id(mnt);
116117
} else {
@@ -119,13 +120,12 @@ void change_mnt_propagation(struct mount *mnt, int type)
119120
}
120121
CLEAR_MNT_SHARED(mnt);
121122
transfer_propagation(mnt, m);
122-
mnt->mnt_master = m;
123123
}
124124
hlist_del_init(&mnt->mnt_slave);
125125
if (type == MS_SLAVE) {
126-
if (mnt->mnt_master)
127-
hlist_add_head(&mnt->mnt_slave,
128-
&mnt->mnt_master->mnt_slave_list);
126+
mnt->mnt_master = m;
127+
if (m)
128+
hlist_add_head(&mnt->mnt_slave, &m->mnt_slave_list);
129129
} else {
130130
mnt->mnt_master = NULL;
131131
if (type == MS_UNBINDABLE)

0 commit comments

Comments
 (0)