Skip to content

Commit 029b10c

Browse files
Tsyvarevtytso
authored andcommitted
ext4: do not destroy ext4_groupinfo_caches if ext4_mb_init() fails
Caches from 'ext4_groupinfo_caches' may be in use by other mounts, which have already existed. So, it is incorrect to destroy them when newly requested mount fails. Found by Linux File System Verification project (linuxtesting.org). Signed-off-by: Andrey Tsyvarev <tsyvarev@ispras.ru> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Lukas Czerner <lczerner@redhat.com>
1 parent c197855 commit 029b10c

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎fs/ext4/mballoc.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,7 +2617,7 @@ int ext4_mb_init(struct super_block *sb)
26172617
sbi->s_locality_groups = alloc_percpu(struct ext4_locality_group);
26182618
if (sbi->s_locality_groups == NULL) {
26192619
ret = -ENOMEM;
2620-
goto out_free_groupinfo_slab;
2620+
goto out;
26212621
}
26222622
for_each_possible_cpu(i) {
26232623
struct ext4_locality_group *lg;
@@ -2642,8 +2642,6 @@ int ext4_mb_init(struct super_block *sb)
26422642
out_free_locality_groups:
26432643
free_percpu(sbi->s_locality_groups);
26442644
sbi->s_locality_groups = NULL;
2645-
out_free_groupinfo_slab:
2646-
ext4_groupinfo_destroy_slabs();
26472645
out:
26482646
kfree(sbi->s_mb_offsets);
26492647
sbi->s_mb_offsets = NULL;

0 commit comments

Comments
 (0)