Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 029b10c5 authored by Andrey Tsyvarev's avatar Andrey Tsyvarev Committed by Theodore Ts'o
Browse files

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: default avatarAndrey Tsyvarev <tsyvarev@ispras.ru>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: default avatarLukas Czerner <lczerner@redhat.com>
parent c197855e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -2617,7 +2617,7 @@ int ext4_mb_init(struct super_block *sb)
	sbi->s_locality_groups = alloc_percpu(struct ext4_locality_group);
	if (sbi->s_locality_groups == NULL) {
		ret = -ENOMEM;
		goto out_free_groupinfo_slab;
		goto out;
	}
	for_each_possible_cpu(i) {
		struct ext4_locality_group *lg;
@@ -2642,8 +2642,6 @@ int ext4_mb_init(struct super_block *sb)
out_free_locality_groups:
	free_percpu(sbi->s_locality_groups);
	sbi->s_locality_groups = NULL;
out_free_groupinfo_slab:
	ext4_groupinfo_destroy_slabs();
out:
	kfree(sbi->s_mb_offsets);
	sbi->s_mb_offsets = NULL;