diff options
| -rw-r--r-- | fs/namespace.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 3273177873f0..ef42d9bee212 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
| @@ -1217,6 +1217,11 @@ static void namespace_unlock(void) | |||
| 1217 | head.first->pprev = &head.first; | 1217 | head.first->pprev = &head.first; |
| 1218 | INIT_HLIST_HEAD(&unmounted); | 1218 | INIT_HLIST_HEAD(&unmounted); |
| 1219 | 1219 | ||
| 1220 | /* undo decrements we'd done in umount_tree() */ | ||
| 1221 | hlist_for_each_entry(mnt, &head, mnt_hash) | ||
| 1222 | if (mnt->mnt_ex_mountpoint.mnt) | ||
| 1223 | mntget(mnt->mnt_ex_mountpoint.mnt); | ||
| 1224 | |||
| 1220 | up_write(&namespace_sem); | 1225 | up_write(&namespace_sem); |
| 1221 | 1226 | ||
| 1222 | synchronize_rcu(); | 1227 | synchronize_rcu(); |
| @@ -1268,6 +1273,7 @@ void umount_tree(struct mount *mnt, int how) | |||
| 1268 | p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; | 1273 | p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; |
| 1269 | if (mnt_has_parent(p)) { | 1274 | if (mnt_has_parent(p)) { |
| 1270 | put_mountpoint(p->mnt_mp); | 1275 | put_mountpoint(p->mnt_mp); |
| 1276 | mnt_add_count(p->mnt_parent, -1); | ||
| 1271 | /* move the reference to mountpoint into ->mnt_ex_mountpoint */ | 1277 | /* move the reference to mountpoint into ->mnt_ex_mountpoint */ |
| 1272 | p->mnt_ex_mountpoint.dentry = p->mnt_mountpoint; | 1278 | p->mnt_ex_mountpoint.dentry = p->mnt_mountpoint; |
| 1273 | p->mnt_ex_mountpoint.mnt = &p->mnt_parent->mnt; | 1279 | p->mnt_ex_mountpoint.mnt = &p->mnt_parent->mnt; |
