]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mnt: Clarify and correct the disconnect logic in umount_tree
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 17 Jul 2015 19:15:30 +0000 (14:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Aug 2015 19:21:54 +0000 (12:21 -0700)
commit4647b34f1a3b08b70f8e20436c7dbec721d47f35
treea1d1336ff47c4ebcf21d8865768a7e34650295dc
parent59366187ef6725cf9c37aec5dd2e6c80aa05a24a
mnt: Clarify and correct the disconnect logic in umount_tree

commit f2d0a123bcf16d1a9cf7942ddc98e0ef77862c2b upstream.

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
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/namespace.c
fs/pnode.h