summaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-01-16 12:57:40 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2010-01-16 12:57:40 -0500
commitdf1a1ad29739f032f8905310796e558589403d61 (patch)
treee8ef57ed776c5dd5615a6fbdb74609c631b7f2a9 /fs/namespace.c
parent8ad08d8a0c3823e9b06ef84c362c9361be323d2d (diff)
downloadlinux-df1a1ad29739f032f8905310796e558589403d61.tar.bz2
attach_recursive_mnt() needs to hold vfsmount_lock over set_mnt_shared()
race in mnt_flags update Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 461090a57b33..4de493ea67cf 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1354,12 +1354,12 @@ static int attach_recursive_mnt(struct vfsmount *source_mnt,
if (err)
goto out_cleanup_ids;
+ spin_lock(&vfsmount_lock);
+
if (IS_MNT_SHARED(dest_mnt)) {
for (p = source_mnt; p; p = next_mnt(p, source_mnt))
set_mnt_shared(p);
}
-
- spin_lock(&vfsmount_lock);
if (parent_path) {
detach_mnt(source_mnt, parent_path);
attach_mnt(source_mnt, path);