summaryrefslogtreecommitdiff
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-01-16 12:56:08 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2010-01-16 12:56:08 -0500
commit8ad08d8a0c3823e9b06ef84c362c9361be323d2d (patch)
tree14b02283f72d5f1345af0cd8c0f305306f6925a6 /fs/namespace.c
parent9b6e31021122babe3b3a67b102479f740928b5eb (diff)
downloadlwn-8ad08d8a0c3823e9b06ef84c362c9361be323d2d.tar.gz
lwn-8ad08d8a0c3823e9b06ef84c362c9361be323d2d.zip
may_umount() needs namespace_sem
otherwise it races with clone_mnt() changing mnt_share/mnt_slaves Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 7d70d63ceb29..461090a57b33 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -965,10 +965,12 @@ EXPORT_SYMBOL(may_umount_tree);
int may_umount(struct vfsmount *mnt)
{
int ret = 1;
+ down_read(&namespace_sem);
spin_lock(&vfsmount_lock);
if (propagate_mount_busy(mnt, 2))
ret = 0;
spin_unlock(&vfsmount_lock);
+ up_read(&namespace_sem);
return ret;
}