]> git.baikalelectronics.ru Git - kernel.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)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 23 Jul 2015 01:33:27 +0000 (20:33 -0500)
commit9d01f02e7390eea860d96d6614eda79158086d4f
tree9ac56ed30a08d7243a2d9bea54d85dcc488aceba
parent0c9e0229f3c4e023815b9350b2095fd8ad5809e3
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: 2f29c17f4b4030236acb2c817e5596ab50a7f0ff mnt: Update detach_mounts to leave mounts connected
Fixes: 0706e207e2b4737923975de98ccdadac6b8e88a4 mnt: Honor MNT_LOCKED when detaching mounts
Cc: stable@vger.kernel.org
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/namespace.c
fs/pnode.h