Convert obvious places to deactivate_locked_super()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 6 May 2009 05:34:22 +0000 (01:34 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 9 May 2009 14:49:40 +0000 (10:49 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 files changed:
drivers/mtd/mtdsuper.c
fs/9p/vfs_super.c
fs/afs/super.c
fs/btrfs/super.c
fs/cifs/cifsfs.c
fs/devpts/inode.c
fs/ecryptfs/main.c
fs/libfs.c
fs/nfs/super.c
fs/proc/root.c
fs/ubifs/super.c
kernel/cgroup.c

index 92285d0089c278dd0e72a60f58f7a912b831f1ec..af8b42e0a55bedfaf3fdae1fc02fa3367e09d011 100644 (file)
@@ -74,8 +74,7 @@ static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags,
 
        ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
        if (ret < 0) {
-               up_write(&sb->s_umount);
-               deactivate_super(sb);
+               deactivate_locked_super(sb);
                return ret;
        }
 
index 7d23214e559913fd23eb13ddede85dbc5d87c636..0d29a57c63e6a11a6152d73f37b09b6916b034ca 100644 (file)
@@ -174,10 +174,7 @@ P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n");
        return 0;
 
 release_sb:
-       if (sb) {
-               up_write(&sb->s_umount);
-               deactivate_super(sb);
-       }
+       deactivate_locked_super(sb);
 
 free_stat:
        kfree(st);
index aee239a048cbfad919a40bfd70fa8fcb37de26fb..2753f16dd31558a0b34c04218c33bf75759eb9bf 100644 (file)
@@ -405,8 +405,7 @@ static int afs_get_sb(struct file_system_type *fs_type,
                sb->s_flags = flags;
                ret = afs_fill_super(sb, &params);
                if (ret < 0) {
-                       up_write(&sb->s_umount);
-                       deactivate_super(sb);
+                       deactivate_locked_super(sb);
                        goto error;
                }
                sb->s_options = new_opts;
index 3536bdb2d7cb0cc22cd149b1b561850881bbb096..6dfae5b28f5939e4dad06410d5c8948eb3574b27 100644 (file)
@@ -502,8 +502,7 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
 
        if (s->s_root) {
                if ((flags ^ s->s_flags) & MS_RDONLY) {
-                       up_write(&s->s_umount);
-                       deactivate_super(s);
+                       deactivate_locked_super(s);
                        error = -EBUSY;
                        goto error_close_devices;
                }
@@ -517,8 +516,7 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
                error = btrfs_fill_super(s, fs_devices, data,
                                         flags & MS_SILENT ? 1 : 0);
                if (error) {
-                       up_write(&s->s_umount);
-                       deactivate_super(s);
+                       deactivate_locked_super(s);
                        goto error_free_subvol_name;
                }
 
@@ -535,15 +533,13 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
                mutex_unlock(&s->s_root->d_inode->i_mutex);
 
                if (IS_ERR(root)) {
-                       up_write(&s->s_umount);
-                       deactivate_super(s);
+                       deactivate_locked_super(s);
                        error = PTR_ERR(root);
                        goto error_free_subvol_name;
                }
                if (!root->d_inode) {
                        dput(root);
-                       up_write(&s->s_umount);
-                       deactivate_super(s);
+                       deactivate_locked_super(s);
                        error = -ENXIO;
                        goto error_free_subvol_name;
                }
index 355e0efec0cf726f6b711d2e0ac98988aa057348..5e6d35804d73511162230f67626aeaf331333982 100644 (file)
@@ -602,8 +602,7 @@ cifs_get_sb(struct file_system_type *fs_type,
 
        rc = cifs_read_super(sb, data, dev_name, flags & MS_SILENT ? 1 : 0);
        if (rc) {
-               up_write(&sb->s_umount);
-               deactivate_super(sb);
+               deactivate_locked_super(sb);
                return rc;
        }
        sb->s_flags |= MS_ACTIVE;
index 63a4a59e4148deae2a7709b2c9cd6722d3422d2a..21165cf934ff7e79522daa66c5c692cfe10593e9 100644 (file)
@@ -389,11 +389,10 @@ static int devpts_get_sb(struct file_system_type *fs_type,
        return 0;
 
 out_dput:
-       dput(s->s_root);
+       dput(s->s_root); /* undo dget() in simple_set_mnt() */
 
 out_undo_sget:
-       up_write(&s->s_umount);
-       deactivate_super(s);
+       deactivate_locked_super(s);
        return error;
 }
 
index ccabd5faa04da4b6670d230725e6b16eebb85f6a..9f0aa9883c28544cfe6a91921f4d32aa7e9dab40 100644 (file)
@@ -614,9 +614,8 @@ static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags,
        }
        goto out;
 out_abort:
-       dput(sb->s_root);
-       up_write(&sb->s_umount);
-       deactivate_super(sb);
+       dput(sb->s_root); /* aka mnt->mnt_root, as set by get_sb_nodev() */
+       deactivate_locked_super(sb);
 out:
        return rc;
 }
index cd223190c4e948c5bb1f55416049a88cadbd04a4..80046ddf5063a41768e8063ac405ce5d55e92aef 100644 (file)
@@ -246,8 +246,7 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
        return 0;
 
 Enomem:
-       up_write(&s->s_umount);
-       deactivate_super(s);
+       deactivate_locked_super(s);
        return -ENOMEM;
 }
 
index 1679a164c8c9ac26518fc6ad51ff86ad18970151..d2d67781c579f34d3990dbe17706e9f98994bfea 100644 (file)
@@ -2111,8 +2111,7 @@ out_err_nosb:
 error_splat_root:
        dput(mntroot);
 error_splat_super:
-       up_write(&s->s_umount);
-       deactivate_super(s);
+       deactivate_locked_super(s);
        goto out;
 }
 
@@ -2208,8 +2207,7 @@ out_err_noserver:
        return error;
 
 error_splat_super:
-       up_write(&s->s_umount);
-       deactivate_super(s);
+       deactivate_locked_super(s);
        dprintk("<-- nfs_xdev_get_sb() = %d [splat]\n", error);
        return error;
 }
@@ -2469,8 +2467,7 @@ out_free:
 error_splat_root:
        dput(mntroot);
 error_splat_super:
-       up_write(&s->s_umount);
-       deactivate_super(s);
+       deactivate_locked_super(s);
        goto out;
 }
 
@@ -2564,8 +2561,7 @@ out_err_noserver:
        return error;
 
 error_splat_super:
-       up_write(&s->s_umount);
-       deactivate_super(s);
+       deactivate_locked_super(s);
        dprintk("<-- nfs4_xdev_get_sb() = %d [splat]\n", error);
        return error;
 }
@@ -2649,8 +2645,7 @@ out_err_noserver:
        return error;
 
 error_splat_super:
-       up_write(&s->s_umount);
-       deactivate_super(s);
+       deactivate_locked_super(s);
        dprintk("<-- nfs4_referral_get_sb() = %d [splat]\n", error);
        return error;
 }
index 1e15a2b176e85a69a4657790009c58976c6dab75..b080b791d9e313b580882a0163de92fbb22886b9 100644 (file)
@@ -67,8 +67,7 @@ static int proc_get_sb(struct file_system_type *fs_type,
                sb->s_flags = flags;
                err = proc_fill_super(sb);
                if (err) {
-                       up_write(&sb->s_umount);
-                       deactivate_super(sb);
+                       deactivate_locked_super(sb);
                        return err;
                }
 
index faa44f90608a26f885208a7b53ff786dcc371f3a..e9f7a754c4f744109236d79b6dacfbe2a4291dc3 100644 (file)
@@ -2055,8 +2055,7 @@ static int ubifs_get_sb(struct file_system_type *fs_type, int flags,
        return 0;
 
 out_deact:
-       up_write(&sb->s_umount);
-       deactivate_super(sb);
+       deactivate_locked_super(sb);
 out_close:
        ubi_close_volume(ubi);
        return err;
index 382109b5baebc2a79d31f041ceb51babd1474c95..a7267bfd3765b930f5b544bbcaf8df23fab3cd06 100644 (file)
@@ -1133,8 +1133,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
  free_cg_links:
        free_cg_links(&tmp_cg_links);
  drop_new_super:
-       up_write(&sb->s_umount);
-       deactivate_super(sb);
+       deactivate_locked_super(sb);
        return ret;
 }