diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2015-07-17 15:15:30 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2015-07-22 21:33:27 -0400 |
commit | f2d0a123bcf16d1a9cf7942ddc98e0ef77862c2b (patch) | |
tree | 9ac56ed30a08d7243a2d9bea54d85dcc488aceba /fs/pnode.h | |
parent | d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754 (diff) |
mnt: Clarify and correct the disconnect logic in umount_tree
rmdir mntpoint will result in an infinite loop when there is
a mount locked on the mountpoint in another mount namespace.
This is because the logic to test to see if a mount should
be disconnected in umount_tree is buggy.
Move the logic to decide if a mount should remain connected to
it's mountpoint into it's own function disconnect_mount so that
clarity of expression instead of terseness of expression becomes
a virtue.
When the conditions where it is invalid to leave a mount connected
are first ruled out, the logic for deciding if a mount should
be disconnected becomes much clearer and simpler.
Fixes: e0c9c0afd2fc958ffa34b697972721d81df8a56f mnt: Update detach_mounts to leave mounts connected
Fixes: ce07d891a0891d3c0d0c2d73d577490486b809e1 mnt: Honor MNT_LOCKED when detaching mounts
Cc: stable@vger.kernel.org
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/pnode.h')
-rw-r--r-- | fs/pnode.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/pnode.h b/fs/pnode.h index 7114ce6e6b9e..0fcdbe7ca648 100644 --- a/fs/pnode.h +++ b/fs/pnode.h | |||
@@ -20,8 +20,6 @@ | |||
20 | #define SET_MNT_MARK(m) ((m)->mnt.mnt_flags |= MNT_MARKED) | 20 | #define SET_MNT_MARK(m) ((m)->mnt.mnt_flags |= MNT_MARKED) |
21 | #define CLEAR_MNT_MARK(m) ((m)->mnt.mnt_flags &= ~MNT_MARKED) | 21 | #define CLEAR_MNT_MARK(m) ((m)->mnt.mnt_flags &= ~MNT_MARKED) |
22 | #define IS_MNT_LOCKED(m) ((m)->mnt.mnt_flags & MNT_LOCKED) | 22 | #define IS_MNT_LOCKED(m) ((m)->mnt.mnt_flags & MNT_LOCKED) |
23 | #define IS_MNT_LOCKED_AND_LAZY(m) \ | ||
24 | (((m)->mnt.mnt_flags & (MNT_LOCKED|MNT_SYNC_UMOUNT)) == MNT_LOCKED) | ||
25 | 23 | ||
26 | #define CL_EXPIRE 0x01 | 24 | #define CL_EXPIRE 0x01 |
27 | #define CL_SLAVE 0x02 | 25 | #define CL_SLAVE 0x02 |