Skip to content

Commit

Permalink
Convert obvious places to deactivate_locked_super()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 9, 2009
1 parent 74dbbdd commit 6f5bbff
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 42 deletions.
3 changes: 1 addition & 2 deletions drivers/mtd/mtdsuper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
5 changes: 1 addition & 4 deletions fs/9p/vfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions fs/afs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 4 additions & 8 deletions fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand All @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions fs/cifs/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
5 changes: 2 additions & 3 deletions fs/ecryptfs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions fs/libfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
15 changes: 5 additions & 10 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2111,8 +2111,7 @@ static int nfs_get_sb(struct file_system_type *fs_type,
error_splat_root:
dput(mntroot);
error_splat_super:
up_write(&s->s_umount);
deactivate_super(s);
deactivate_locked_super(s);
goto out;
}

Expand Down Expand Up @@ -2208,8 +2207,7 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
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;
}
Expand Down Expand Up @@ -2469,8 +2467,7 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
error_splat_root:
dput(mntroot);
error_splat_super:
up_write(&s->s_umount);
deactivate_super(s);
deactivate_locked_super(s);
goto out;
}

Expand Down Expand Up @@ -2564,8 +2561,7 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
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;
}
Expand Down Expand Up @@ -2649,8 +2645,7 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags,
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;
}
Expand Down
3 changes: 1 addition & 2 deletions fs/proc/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 1 addition & 2 deletions fs/ubifs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6f5bbff

Please sign in to comment.