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>
This commit is contained in:
parent
9b6e310211
commit
8ad08d8a0c
1 changed files with 2 additions and 0 deletions
|
@ -965,10 +965,12 @@ EXPORT_SYMBOL(may_umount_tree);
|
||||||
int may_umount(struct vfsmount *mnt)
|
int may_umount(struct vfsmount *mnt)
|
||||||
{
|
{
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
down_read(&namespace_sem);
|
||||||
spin_lock(&vfsmount_lock);
|
spin_lock(&vfsmount_lock);
|
||||||
if (propagate_mount_busy(mnt, 2))
|
if (propagate_mount_busy(mnt, 2))
|
||||||
ret = 0;
|
ret = 0;
|
||||||
spin_unlock(&vfsmount_lock);
|
spin_unlock(&vfsmount_lock);
|
||||||
|
up_read(&namespace_sem);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue