Skip to content

Commit 6f5bbff

Browse files
author
Al Viro
committed
Convert obvious places to deactivate_locked_super()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 74dbbdd commit 6f5bbff

12 files changed

Lines changed: 21 additions & 42 deletions

File tree

‎drivers/mtd/mtdsuper.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags,
7474

7575
ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
7676
if (ret < 0) {
77-
up_write(&sb->s_umount);
78-
deactivate_super(sb);
77+
deactivate_locked_super(sb);
7978
return ret;
8079
}
8180

‎fs/9p/vfs_super.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,7 @@ P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n");
174174
return 0;
175175

176176
release_sb:
177-
if (sb) {
178-
up_write(&sb->s_umount);
179-
deactivate_super(sb);
180-
}
177+
deactivate_locked_super(sb);
181178

182179
free_stat:
183180
kfree(st);

‎fs/afs/super.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,7 @@ static int afs_get_sb(struct file_system_type *fs_type,
405405
sb->s_flags = flags;
406406
ret = afs_fill_super(sb, &params);
407407
if (ret < 0) {
408-
up_write(&sb->s_umount);
409-
deactivate_super(sb);
408+
deactivate_locked_super(sb);
410409
goto error;
411410
}
412411
sb->s_options = new_opts;

‎fs/btrfs/super.c‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,7 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
502502

503503
if (s->s_root) {
504504
if ((flags ^ s->s_flags) & MS_RDONLY) {
505-
up_write(&s->s_umount);
506-
deactivate_super(s);
505+
deactivate_locked_super(s);
507506
error = -EBUSY;
508507
goto error_close_devices;
509508
}
@@ -517,8 +516,7 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
517516
error = btrfs_fill_super(s, fs_devices, data,
518517
flags & MS_SILENT ? 1 : 0);
519518
if (error) {
520-
up_write(&s->s_umount);
521-
deactivate_super(s);
519+
deactivate_locked_super(s);
522520
goto error_free_subvol_name;
523521
}
524522

@@ -535,15 +533,13 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
535533
mutex_unlock(&s->s_root->d_inode->i_mutex);
536534

537535
if (IS_ERR(root)) {
538-
up_write(&s->s_umount);
539-
deactivate_super(s);
536+
deactivate_locked_super(s);
540537
error = PTR_ERR(root);
541538
goto error_free_subvol_name;
542539
}
543540
if (!root->d_inode) {
544541
dput(root);
545-
up_write(&s->s_umount);
546-
deactivate_super(s);
542+
deactivate_locked_super(s);
547543
error = -ENXIO;
548544
goto error_free_subvol_name;
549545
}

‎fs/cifs/cifsfs.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,7 @@ cifs_get_sb(struct file_system_type *fs_type,
602602

603603
rc = cifs_read_super(sb, data, dev_name, flags & MS_SILENT ? 1 : 0);
604604
if (rc) {
605-
up_write(&sb->s_umount);
606-
deactivate_super(sb);
605+
deactivate_locked_super(sb);
607606
return rc;
608607
}
609608
sb->s_flags |= MS_ACTIVE;

‎fs/devpts/inode.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,10 @@ static int devpts_get_sb(struct file_system_type *fs_type,
389389
return 0;
390390

391391
out_dput:
392-
dput(s->s_root);
392+
dput(s->s_root); /* undo dget() in simple_set_mnt() */
393393

394394
out_undo_sget:
395-
up_write(&s->s_umount);
396-
deactivate_super(s);
395+
deactivate_locked_super(s);
397396
return error;
398397
}
399398

‎fs/ecryptfs/main.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,8 @@ static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags,
614614
}
615615
goto out;
616616
out_abort:
617-
dput(sb->s_root);
618-
up_write(&sb->s_umount);
619-
deactivate_super(sb);
617+
dput(sb->s_root); /* aka mnt->mnt_root, as set by get_sb_nodev() */
618+
deactivate_locked_super(sb);
620619
out:
621620
return rc;
622621
}

‎fs/libfs.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
246246
return 0;
247247

248248
Enomem:
249-
up_write(&s->s_umount);
250-
deactivate_super(s);
249+
deactivate_locked_super(s);
251250
return -ENOMEM;
252251
}
253252

‎fs/nfs/super.c‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,8 +2111,7 @@ static int nfs_get_sb(struct file_system_type *fs_type,
21112111
error_splat_root:
21122112
dput(mntroot);
21132113
error_splat_super:
2114-
up_write(&s->s_umount);
2115-
deactivate_super(s);
2114+
deactivate_locked_super(s);
21162115
goto out;
21172116
}
21182117

@@ -2208,8 +2207,7 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
22082207
return error;
22092208

22102209
error_splat_super:
2211-
up_write(&s->s_umount);
2212-
deactivate_super(s);
2210+
deactivate_locked_super(s);
22132211
dprintk("<-- nfs_xdev_get_sb() = %d [splat]\n", error);
22142212
return error;
22152213
}
@@ -2469,8 +2467,7 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
24692467
error_splat_root:
24702468
dput(mntroot);
24712469
error_splat_super:
2472-
up_write(&s->s_umount);
2473-
deactivate_super(s);
2470+
deactivate_locked_super(s);
24742471
goto out;
24752472
}
24762473

@@ -2564,8 +2561,7 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
25642561
return error;
25652562

25662563
error_splat_super:
2567-
up_write(&s->s_umount);
2568-
deactivate_super(s);
2564+
deactivate_locked_super(s);
25692565
dprintk("<-- nfs4_xdev_get_sb() = %d [splat]\n", error);
25702566
return error;
25712567
}
@@ -2649,8 +2645,7 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags,
26492645
return error;
26502646

26512647
error_splat_super:
2652-
up_write(&s->s_umount);
2653-
deactivate_super(s);
2648+
deactivate_locked_super(s);
26542649
dprintk("<-- nfs4_referral_get_sb() = %d [splat]\n", error);
26552650
return error;
26562651
}

‎fs/proc/root.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ static int proc_get_sb(struct file_system_type *fs_type,
6767
sb->s_flags = flags;
6868
err = proc_fill_super(sb);
6969
if (err) {
70-
up_write(&sb->s_umount);
71-
deactivate_super(sb);
70+
deactivate_locked_super(sb);
7271
return err;
7372
}
7473

0 commit comments

Comments
 (0)