diff options
author | Patrick McHardy <kaber@trash.net> | 2010-02-10 14:17:10 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-02-10 14:17:10 +0100 |
commit | 9ab99d5a43e9f283738fd9fd365539306d13eaac (patch) | |
tree | 0214a63e3f4f7f4f187f0139e4a5d8abe453902b /fs/namespace.c | |
parent | 76780373190d7e8ddfb6fed06aef068e2445c743 (diff) | |
parent | b1109bf085c8dd69537b7876ea83f914dd1fe46a (diff) | |
download | kernel_samsung_espresso10-9ab99d5a43e9f283738fd9fd365539306d13eaac.zip kernel_samsung_espresso10-9ab99d5a43e9f283738fd9fd365539306d13eaac.tar.gz kernel_samsung_espresso10-9ab99d5a43e9f283738fd9fd365539306d13eaac.tar.bz2 |
Merge branch 'master' of /repos/git/net-next-2.6
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 7d70d63..c768f73 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; } @@ -1352,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); @@ -1534,8 +1536,12 @@ static int do_remount(struct path *path, int flags, int mnt_flags, err = change_mount_flags(path->mnt, flags); else err = do_remount_sb(sb, flags, data, 0); - if (!err) + if (!err) { + spin_lock(&vfsmount_lock); + mnt_flags |= path->mnt->mnt_flags & MNT_PNODE_MASK; path->mnt->mnt_flags = mnt_flags; + spin_unlock(&vfsmount_lock); + } up_write(&sb->s_umount); if (!err) { security_sb_post_remount(path->mnt, flags, data); @@ -1665,6 +1671,8 @@ int do_add_mount(struct vfsmount *newmnt, struct path *path, { int err; + mnt_flags &= ~(MNT_SHARED | MNT_WRITE_HOLD); + down_write(&namespace_sem); /* Something was mounted here while we slept */ while (d_mountpoint(path->dentry) && |