Skip to content

Commit

Permalink
get rid of propagate_umount() mistakenly treating slaves as busy.
Browse files Browse the repository at this point in the history
The check in __propagate_umount() ("has somebody explicitly mounted
something on that slave?") is done *before* taking the already doomed
victims out of the child lists.

Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Aug 30, 2014
1 parent 52addcf commit 88b368f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,9 @@ void umount_tree(struct mount *mnt, int how)
hlist_add_head(&p->mnt_hash, &tmp_list);
}

hlist_for_each_entry(p, &tmp_list, mnt_hash)
list_del_init(&p->mnt_child);

if (how)
propagate_umount(&tmp_list);

Expand All @@ -1263,7 +1266,6 @@ void umount_tree(struct mount *mnt, int how)
p->mnt_ns = NULL;
if (how < 2)
p->mnt.mnt_flags |= MNT_SYNC_UMOUNT;
list_del_init(&p->mnt_child);
if (mnt_has_parent(p)) {
put_mountpoint(p->mnt_mp);
/* move the reference to mountpoint into ->mnt_ex_mountpoint */
Expand Down
1 change: 1 addition & 0 deletions fs/pnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ static void __propagate_umount(struct mount *mnt)
* other children
*/
if (child && list_empty(&child->mnt_mounts)) {
list_del_init(&child->mnt_child);
hlist_del_init_rcu(&child->mnt_hash);
hlist_add_before_rcu(&child->mnt_hash, &mnt->mnt_hash);
}
Expand Down

0 comments on commit 88b368f

Please sign in to comment.