summaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-02-15 21:20:18 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-02-15 21:20:18 +0000
commit56012808f4d5606e401539f663d92009d964425b (patch)
treef3736a97725647393a2db7c95462d857115197ca /fs/namespace.c
parenta814290e17ae314bd614476cffc6119846eca27e (diff)
parentb2a731aa5cbca7e0252da75e16de7ae5feb1313a (diff)
downloadop-kernel-dev-56012808f4d5606e401539f663d92009d964425b.zip
op-kernel-dev-56012808f4d5606e401539f663d92009d964425b.tar.gz
Merge branch 'for-rmk' of git://git.marvell.com/orion into devel-stable
Conflicts: arch/arm/Makefile
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c14
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) &&
OpenPOWER on IntegriCloud