Skip to content

Commit

Permalink
BKL: Remove BKL from ext3 fill_super()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Blunck authored and Arnd Bergmann committed Oct 4, 2010
1 parent b0991aa commit d646cf8
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions fs/ext3/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1611,19 +1611,14 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
__le32 features;
int err;

lock_kernel();

sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
if (!sbi) {
unlock_kernel();
if (!sbi)
return -ENOMEM;
}

sbi->s_blockgroup_lock =
kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL);
if (!sbi->s_blockgroup_lock) {
kfree(sbi);
unlock_kernel();
return -ENOMEM;
}
sb->s_fs_info = sbi;
Expand All @@ -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_sb_block = sb_block;

unlock_kernel();

blocksize = sb_min_blocksize(sb, EXT3_MIN_BLOCK_SIZE);
if (!blocksize) {
ext3_msg(sb, KERN_ERR, "error: unable to set blocksize");
Expand Down Expand Up @@ -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":
"writeback");

lock_kernel();
unlock_kernel();
return 0;

cantfind_ext3:
Expand Down Expand Up @@ -2061,8 +2052,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
sb->s_fs_info = NULL;
kfree(sbi->s_blockgroup_lock);
kfree(sbi);
lock_kernel();
unlock_kernel();
return ret;
}

Expand Down

0 comments on commit d646cf8

Please sign in to comment.