Skip to content

Commit

Permalink
attach_recursive_mnt() needs to hold vfsmount_lock over set_mnt_shared()
Browse files Browse the repository at this point in the history
race in mnt_flags update

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jan 16, 2010
1 parent 8ad08d8 commit df1a1ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit df1a1ad

Please sign in to comment.