BKL: Remove BKL from ext3 fill_super()

The BKL is protecting nothing than two memory allocations here.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Jan Blunck 2010-02-24 13:25:29 +01:00 committed by Arnd Bergmann
parent b0991aa324
commit d646cf82e9

View File

@ -1611,19 +1611,14 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
__le32 features; __le32 features;
int err; int err;
lock_kernel();
sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
if (!sbi) { if (!sbi)
unlock_kernel();
return -ENOMEM; return -ENOMEM;
}
sbi->s_blockgroup_lock = sbi->s_blockgroup_lock =
kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL); kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL);
if (!sbi->s_blockgroup_lock) { if (!sbi->s_blockgroup_lock) {
kfree(sbi); kfree(sbi);
unlock_kernel();
return -ENOMEM; return -ENOMEM;
} }
sb->s_fs_info = sbi; sb->s_fs_info = sbi;
@ -1632,8 +1627,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
sbi->s_resgid = EXT3_DEF_RESGID; sbi->s_resgid = EXT3_DEF_RESGID;
sbi->s_sb_block = sb_block; sbi->s_sb_block = sb_block;
unlock_kernel();
blocksize = sb_min_blocksize(sb, EXT3_MIN_BLOCK_SIZE); blocksize = sb_min_blocksize(sb, EXT3_MIN_BLOCK_SIZE);
if (!blocksize) { if (!blocksize) {
ext3_msg(sb, KERN_ERR, "error: unable to set blocksize"); ext3_msg(sb, KERN_ERR, "error: unable to set blocksize");
@ -2030,8 +2023,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA ? "ordered": test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA ? "ordered":
"writeback"); "writeback");
lock_kernel();
unlock_kernel();
return 0; return 0;
cantfind_ext3: cantfind_ext3:
@ -2061,8 +2052,6 @@ out_fail:
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
kfree(sbi->s_blockgroup_lock); kfree(sbi->s_blockgroup_lock);
kfree(sbi); kfree(sbi);
lock_kernel();
unlock_kernel();
return ret; return ret;
} }