aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2025-06-24 23:20:47 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2025-06-29 19:03:30 -0400
commitd5f15047f13b86b74d1ac4f39036ccae2078c492 (patch)
tree9fd81885f7b272779e26c742e229ac798524eb09
parent0313356520b15deab893cd62da3e2ba9a6e61a1f (diff)
downloadtip-d5f15047f13b86b74d1ac4f39036ccae2078c492.tar.gz
change_mnt_propagation() cleanups, step 1
Lift changing ->mnt_slave from do_make_slave() into the caller. Simplifies the next steps... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/pnode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/pnode.c b/fs/pnode.c
index b887116f0041af..14618eac20254e 100644
--- a/fs/pnode.c
+++ b/fs/pnode.c
@@ -104,7 +104,6 @@ static int do_make_slave(struct mount *mnt)
}
list_for_each_entry(slave_mnt, &mnt->mnt_slave_list, mnt_slave)
slave_mnt->mnt_master = master;
- list_move(&mnt->mnt_slave, &master->mnt_slave_list);
list_splice(&mnt->mnt_slave_list, master->mnt_slave_list.prev);
INIT_LIST_HEAD(&mnt->mnt_slave_list);
mnt->mnt_master = master;
@@ -121,8 +120,12 @@ void change_mnt_propagation(struct mount *mnt, int type)
return;
}
do_make_slave(mnt);
- if (type != MS_SLAVE) {
- list_del_init(&mnt->mnt_slave);
+ list_del_init(&mnt->mnt_slave);
+ if (type == MS_SLAVE) {
+ if (mnt->mnt_master)
+ list_add(&mnt->mnt_slave,
+ &mnt->mnt_master->mnt_slave_list);
+ } else {
mnt->mnt_master = NULL;
if (type == MS_UNBINDABLE)
mnt->mnt_t_flags |= T_UNBINDABLE;