diff options
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index f016707597a7..012c4251397e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -576,6 +576,11 @@ static void ext4_put_super(struct super_block *sb) | |||
576 | struct ext4_super_block *es = sbi->s_es; | 576 | struct ext4_super_block *es = sbi->s_es; |
577 | int i, err; | 577 | int i, err; |
578 | 578 | ||
579 | lock_super(sb); | ||
580 | lock_kernel(); | ||
581 | if (sb->s_dirt) | ||
582 | ext4_commit_super(sb, 1); | ||
583 | |||
579 | ext4_release_system_zone(sb); | 584 | ext4_release_system_zone(sb); |
580 | ext4_mb_release(sb); | 585 | ext4_mb_release(sb); |
581 | ext4_ext_release(sb); | 586 | ext4_ext_release(sb); |
@@ -642,8 +647,6 @@ static void ext4_put_super(struct super_block *sb) | |||
642 | unlock_super(sb); | 647 | unlock_super(sb); |
643 | kobject_put(&sbi->s_kobj); | 648 | kobject_put(&sbi->s_kobj); |
644 | wait_for_completion(&sbi->s_kobj_unregister); | 649 | wait_for_completion(&sbi->s_kobj_unregister); |
645 | lock_super(sb); | ||
646 | lock_kernel(); | ||
647 | kfree(sbi->s_blockgroup_lock); | 650 | kfree(sbi->s_blockgroup_lock); |
648 | kfree(sbi); | 651 | kfree(sbi); |
649 | } | 652 | } |
@@ -3333,7 +3336,9 @@ int ext4_force_commit(struct super_block *sb) | |||
3333 | 3336 | ||
3334 | static void ext4_write_super(struct super_block *sb) | 3337 | static void ext4_write_super(struct super_block *sb) |
3335 | { | 3338 | { |
3339 | lock_super(sb); | ||
3336 | ext4_commit_super(sb, 1); | 3340 | ext4_commit_super(sb, 1); |
3341 | unlock_super(sb); | ||
3337 | } | 3342 | } |
3338 | 3343 | ||
3339 | static int ext4_sync_fs(struct super_block *sb, int wait) | 3344 | static int ext4_sync_fs(struct super_block *sb, int wait) |
@@ -3417,7 +3422,10 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
3417 | int i; | 3422 | int i; |
3418 | #endif | 3423 | #endif |
3419 | 3424 | ||
3425 | lock_kernel(); | ||
3426 | |||
3420 | /* Store the original options */ | 3427 | /* Store the original options */ |
3428 | lock_super(sb); | ||
3421 | old_sb_flags = sb->s_flags; | 3429 | old_sb_flags = sb->s_flags; |
3422 | old_opts.s_mount_opt = sbi->s_mount_opt; | 3430 | old_opts.s_mount_opt = sbi->s_mount_opt; |
3423 | old_opts.s_resuid = sbi->s_resuid; | 3431 | old_opts.s_resuid = sbi->s_resuid; |
@@ -3551,6 +3559,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
3551 | old_opts.s_qf_names[i] != sbi->s_qf_names[i]) | 3559 | old_opts.s_qf_names[i] != sbi->s_qf_names[i]) |
3552 | kfree(old_opts.s_qf_names[i]); | 3560 | kfree(old_opts.s_qf_names[i]); |
3553 | #endif | 3561 | #endif |
3562 | unlock_super(sb); | ||
3563 | unlock_kernel(); | ||
3554 | return 0; | 3564 | return 0; |
3555 | 3565 | ||
3556 | restore_opts: | 3566 | restore_opts: |
@@ -3570,6 +3580,8 @@ restore_opts: | |||
3570 | sbi->s_qf_names[i] = old_opts.s_qf_names[i]; | 3580 | sbi->s_qf_names[i] = old_opts.s_qf_names[i]; |
3571 | } | 3581 | } |
3572 | #endif | 3582 | #endif |
3583 | unlock_super(sb); | ||
3584 | unlock_kernel(); | ||
3573 | return err; | 3585 | return err; |
3574 | } | 3586 | } |
3575 | 3587 | ||