Skip to content

Commit d646cf8

Browse files
jblunckarndb
authored andcommitted
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>
1 parent b0991aa commit d646cf8

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

‎fs/ext3/super.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,19 +1611,14 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
16111611
__le32 features;
16121612
int err;
16131613

1614-
lock_kernel();
1615-
16161614
sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
1617-
if (!sbi) {
1618-
unlock_kernel();
1615+
if (!sbi)
16191616
return -ENOMEM;
1620-
}
16211617

16221618
sbi->s_blockgroup_lock =
16231619
kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL);
16241620
if (!sbi->s_blockgroup_lock) {
16251621
kfree(sbi);
1626-
unlock_kernel();
16271622
return -ENOMEM;
16281623
}
16291624
sb->s_fs_info = sbi;
@@ -1632,8 +1627,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
16321627
sbi->s_resgid = EXT3_DEF_RESGID;
16331628
sbi->s_sb_block = sb_block;
16341629

1635-
unlock_kernel();
1636-
16371630
blocksize = sb_min_blocksize(sb, EXT3_MIN_BLOCK_SIZE);
16381631
if (!blocksize) {
16391632
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)
20302023
test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA ? "ordered":
20312024
"writeback");
20322025

2033-
lock_kernel();
2034-
unlock_kernel();
20352026
return 0;
20362027

20372028
cantfind_ext3:
@@ -2061,8 +2052,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
20612052
sb->s_fs_info = NULL;
20622053
kfree(sbi->s_blockgroup_lock);
20632054
kfree(sbi);
2064-
lock_kernel();
2065-
unlock_kernel();
20662055
return ret;
20672056
}
20682057

0 commit comments

Comments
 (0)