Commit f2143c4e authored by Jan Blunck's avatar Jan Blunck Committed by Arnd Bergmann

BKL: Remove BKL from ext4 filesystem

The BKL is still used in ext4_put_super(), ext4_fill_super() and
ext4_remount(). All three calles are protected against concurrent calls by
the s_umount rw semaphore of struct super_block.

Therefore the BKL is protecting nothing in this case.
Signed-off-by: default avatarJan Blunck <jblunck@infradead.org>
Acked-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 77b54a46
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/parser.h> #include <linux/parser.h>
#include <linux/smp_lock.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/exportfs.h> #include <linux/exportfs.h>
#include <linux/vfs.h> #include <linux/vfs.h>
...@@ -708,7 +707,6 @@ static void ext4_put_super(struct super_block *sb) ...@@ -708,7 +707,6 @@ static void ext4_put_super(struct super_block *sb)
destroy_workqueue(sbi->dio_unwritten_wq); destroy_workqueue(sbi->dio_unwritten_wq);
lock_super(sb); lock_super(sb);
lock_kernel();
if (sb->s_dirt) if (sb->s_dirt)
ext4_commit_super(sb, 1); ext4_commit_super(sb, 1);
...@@ -775,7 +773,6 @@ static void ext4_put_super(struct super_block *sb) ...@@ -775,7 +773,6 @@ static void ext4_put_super(struct super_block *sb)
* Now that we are completely done shutting down the * Now that we are completely done shutting down the
* superblock, we need to actually destroy the kobject. * superblock, we need to actually destroy the kobject.
*/ */
unlock_kernel();
unlock_super(sb); unlock_super(sb);
kobject_put(&sbi->s_kobj); kobject_put(&sbi->s_kobj);
wait_for_completion(&sbi->s_kobj_unregister); wait_for_completion(&sbi->s_kobj_unregister);
...@@ -2568,8 +2565,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -2568,8 +2565,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
int err; int err;
unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO; unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO;
lock_kernel();
sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
if (!sbi) if (!sbi)
goto out_free_orig; goto out_free_orig;
...@@ -2590,8 +2585,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -2590,8 +2585,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
sbi->s_sectors_written_start = sbi->s_sectors_written_start =
part_stat_read(sb->s_bdev->bd_part, sectors[1]); part_stat_read(sb->s_bdev->bd_part, sectors[1]);
unlock_kernel();
/* Cleanup superblock name */ /* Cleanup superblock name */
for (cp = sb->s_id; (cp = strchr(cp, '/'));) for (cp = sb->s_id; (cp = strchr(cp, '/'));)
*cp = '!'; *cp = '!';
...@@ -3214,11 +3207,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -3214,11 +3207,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
kfree(sbi->s_blockgroup_lock); kfree(sbi->s_blockgroup_lock);
kfree(sbi); kfree(sbi);
kfree(orig_data);
return ret;
out_free_orig: out_free_orig:
unlock_kernel();
kfree(orig_data); kfree(orig_data);
return ret; return ret;
} }
...@@ -3726,8 +3715,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) ...@@ -3726,8 +3715,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
#endif #endif
char *orig_data = kstrdup(data, GFP_KERNEL); char *orig_data = kstrdup(data, GFP_KERNEL);
lock_kernel();
/* Store the original options */ /* Store the original options */
lock_super(sb); lock_super(sb);
old_sb_flags = sb->s_flags; old_sb_flags = sb->s_flags;
...@@ -3862,7 +3849,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) ...@@ -3862,7 +3849,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
kfree(old_opts.s_qf_names[i]); kfree(old_opts.s_qf_names[i]);
#endif #endif
unlock_super(sb); unlock_super(sb);
unlock_kernel();
if (enable_quota) if (enable_quota)
dquot_resume(sb, -1); dquot_resume(sb, -1);
...@@ -3888,7 +3874,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) ...@@ -3888,7 +3874,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
} }
#endif #endif
unlock_super(sb); unlock_super(sb);
unlock_kernel();
kfree(orig_data); kfree(orig_data);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment