File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -104,13 +104,14 @@ static void transfer_propagation(struct mount *mnt, struct mount *to)
104104 */
105105void 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 )
You can’t perform that action at this time.
0 commit comments