diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2014-08-18 15:09:26 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-08-30 18:31:41 -0400 |
| commit | 88b368f27a094277143d8ecd5a056116f6a41520 (patch) | |
| tree | 70dbec3575942bad615cab61ab9061f2b8228128 | |
| parent | 52addcf9d6669fa439387610bc65c92fa0980cef (diff) | |
get rid of propagate_umount() mistakenly treating slaves as busy.
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>
| -rw-r--r-- | fs/namespace.c | 4 | ||||
| -rw-r--r-- | fs/pnode.c | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index a01c7730e9af..3273177873f0 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
| @@ -1253,6 +1253,9 @@ void umount_tree(struct mount *mnt, int how) | |||
| 1253 | hlist_add_head(&p->mnt_hash, &tmp_list); | 1253 | hlist_add_head(&p->mnt_hash, &tmp_list); |
| 1254 | } | 1254 | } |
| 1255 | 1255 | ||
| 1256 | hlist_for_each_entry(p, &tmp_list, mnt_hash) | ||
| 1257 | list_del_init(&p->mnt_child); | ||
| 1258 | |||
| 1256 | if (how) | 1259 | if (how) |
| 1257 | propagate_umount(&tmp_list); | 1260 | propagate_umount(&tmp_list); |
| 1258 | 1261 | ||
| @@ -1263,7 +1266,6 @@ void umount_tree(struct mount *mnt, int how) | |||
| 1263 | p->mnt_ns = NULL; | 1266 | p->mnt_ns = NULL; |
| 1264 | if (how < 2) | 1267 | if (how < 2) |
| 1265 | p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; | 1268 | p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; |
| 1266 | list_del_init(&p->mnt_child); | ||
| 1267 | if (mnt_has_parent(p)) { | 1269 | if (mnt_has_parent(p)) { |
| 1268 | put_mountpoint(p->mnt_mp); | 1270 | put_mountpoint(p->mnt_mp); |
| 1269 | /* move the reference to mountpoint into ->mnt_ex_mountpoint */ | 1271 | /* move the reference to mountpoint into ->mnt_ex_mountpoint */ |
diff --git a/fs/pnode.c b/fs/pnode.c index 302bf22c4a30..aae331a5d03b 100644 --- a/fs/pnode.c +++ b/fs/pnode.c | |||
| @@ -381,6 +381,7 @@ static void __propagate_umount(struct mount *mnt) | |||
| 381 | * other children | 381 | * other children |
| 382 | */ | 382 | */ |
| 383 | if (child && list_empty(&child->mnt_mounts)) { | 383 | if (child && list_empty(&child->mnt_mounts)) { |
| 384 | list_del_init(&child->mnt_child); | ||
| 384 | hlist_del_init_rcu(&child->mnt_hash); | 385 | hlist_del_init_rcu(&child->mnt_hash); |
| 385 | hlist_add_before_rcu(&child->mnt_hash, &mnt->mnt_hash); | 386 | hlist_add_before_rcu(&child->mnt_hash, &mnt->mnt_hash); |
| 386 | } | 387 | } |
