@@ -344,6 +344,7 @@ static struct mount *alloc_vfsmnt(const char *name)
344
344
INIT_HLIST_NODE (& mnt -> mnt_mp_list );
345
345
INIT_LIST_HEAD (& mnt -> mnt_umounting );
346
346
INIT_HLIST_HEAD (& mnt -> mnt_stuck_children );
347
+ RB_CLEAR_NODE (& mnt -> mnt_node );
347
348
mnt -> mnt .mnt_idmap = & nop_mnt_idmap ;
348
349
}
349
350
return mnt ;
@@ -1124,7 +1125,7 @@ static void mnt_add_to_ns(struct mnt_namespace *ns, struct mount *mnt)
1124
1125
struct rb_node * * link = & ns -> mounts .rb_node ;
1125
1126
struct rb_node * parent = NULL ;
1126
1127
1127
- WARN_ON (mnt -> mnt . mnt_flags & MNT_ONRB );
1128
+ WARN_ON (mnt_ns_attached ( mnt ) );
1128
1129
mnt -> mnt_ns = ns ;
1129
1130
while (* link ) {
1130
1131
parent = * link ;
@@ -1135,7 +1136,6 @@ static void mnt_add_to_ns(struct mnt_namespace *ns, struct mount *mnt)
1135
1136
}
1136
1137
rb_link_node (& mnt -> mnt_node , parent , link );
1137
1138
rb_insert_color (& mnt -> mnt_node , & ns -> mounts );
1138
- mnt -> mnt .mnt_flags |= MNT_ONRB ;
1139
1139
}
1140
1140
1141
1141
/*
@@ -1305,7 +1305,7 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
1305
1305
}
1306
1306
1307
1307
mnt -> mnt .mnt_flags = old -> mnt .mnt_flags ;
1308
- mnt -> mnt .mnt_flags &= ~(MNT_WRITE_HOLD |MNT_MARKED |MNT_INTERNAL | MNT_ONRB );
1308
+ mnt -> mnt .mnt_flags &= ~(MNT_WRITE_HOLD |MNT_MARKED |MNT_INTERNAL );
1309
1309
1310
1310
atomic_inc (& sb -> s_active );
1311
1311
mnt -> mnt .mnt_idmap = mnt_idmap_get (mnt_idmap (& old -> mnt ));
@@ -1763,7 +1763,7 @@ static void umount_tree(struct mount *mnt, enum umount_tree_flags how)
1763
1763
/* Gather the mounts to umount */
1764
1764
for (p = mnt ; p ; p = next_mnt (p , mnt )) {
1765
1765
p -> mnt .mnt_flags |= MNT_UMOUNT ;
1766
- if (p -> mnt . mnt_flags & MNT_ONRB )
1766
+ if (mnt_ns_attached ( p ) )
1767
1767
move_from_ns (p , & tmp_list );
1768
1768
else
1769
1769
list_move (& p -> mnt_list , & tmp_list );
@@ -1912,16 +1912,14 @@ static int do_umount(struct mount *mnt, int flags)
1912
1912
1913
1913
event ++ ;
1914
1914
if (flags & MNT_DETACH ) {
1915
- if (mnt -> mnt .mnt_flags & MNT_ONRB ||
1916
- !list_empty (& mnt -> mnt_list ))
1915
+ if (mnt_ns_attached (mnt ) || !list_empty (& mnt -> mnt_list ))
1917
1916
umount_tree (mnt , UMOUNT_PROPAGATE );
1918
1917
retval = 0 ;
1919
1918
} else {
1920
1919
shrink_submounts (mnt );
1921
1920
retval = - EBUSY ;
1922
1921
if (!propagate_mount_busy (mnt , 2 )) {
1923
- if (mnt -> mnt .mnt_flags & MNT_ONRB ||
1924
- !list_empty (& mnt -> mnt_list ))
1922
+ if (mnt_ns_attached (mnt ) || !list_empty (& mnt -> mnt_list ))
1925
1923
umount_tree (mnt , UMOUNT_PROPAGATE |UMOUNT_SYNC );
1926
1924
retval = 0 ;
1927
1925
}
0 commit comments