aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index e8f7f8c58c3c..1f4f9dac6e5a 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1348,6 +1348,7 @@ static inline void namespace_lock(void)
1348enum umount_tree_flags { 1348enum umount_tree_flags {
1349 UMOUNT_SYNC = 1, 1349 UMOUNT_SYNC = 1,
1350 UMOUNT_PROPAGATE = 2, 1350 UMOUNT_PROPAGATE = 2,
1351 UMOUNT_CONNECTED = 4,
1351}; 1352};
1352/* 1353/*
1353 * mount_lock must be held 1354 * mount_lock must be held
@@ -1386,7 +1387,10 @@ static void umount_tree(struct mount *mnt, enum umount_tree_flags how)
1386 if (how & UMOUNT_SYNC) 1387 if (how & UMOUNT_SYNC)
1387 p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; 1388 p->mnt.mnt_flags |= MNT_SYNC_UMOUNT;
1388 1389
1389 disconnect = !IS_MNT_LOCKED_AND_LAZY(p); 1390 disconnect = !(((how & UMOUNT_CONNECTED) &&
1391 mnt_has_parent(p) &&
1392 (p->mnt_parent->mnt.mnt_flags & MNT_UMOUNT)) ||
1393 IS_MNT_LOCKED_AND_LAZY(p));
1390 1394
1391 pin_insert_group(&p->mnt_umount, &p->mnt_parent->mnt, 1395 pin_insert_group(&p->mnt_umount, &p->mnt_parent->mnt,
1392 disconnect ? &unmounted : NULL); 1396 disconnect ? &unmounted : NULL);
@@ -1529,7 +1533,7 @@ void __detach_mounts(struct dentry *dentry)
1529 umount_mnt(p); 1533 umount_mnt(p);
1530 } 1534 }
1531 } 1535 }
1532 else umount_tree(mnt, 0); 1536 else umount_tree(mnt, UMOUNT_CONNECTED);
1533 } 1537 }
1534 unlock_mount_hash(); 1538 unlock_mount_hash();
1535 put_mountpoint(mp); 1539 put_mountpoint(mp);