aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
authorAndrey Tsyvarev <tsyvarev@ispras.ru>2014-05-12 12:34:21 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-05-12 12:34:21 -0400
commit029b10c5a8d9e9db528eea66f5728ccca56c2f27 (patch)
tree48af4a9fbc52c0c62a3931eb4aa95dc34ef1e076 /fs/ext4/mballoc.c
parentc197855ea14175a25003c276824689e8ba318e53 (diff)
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>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index c8238a26818c..3235a2fd7e7e 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2617,7 +2617,7 @@ int ext4_mb_init(struct super_block *sb)
2617 sbi->s_locality_groups = alloc_percpu(struct ext4_locality_group); 2617 sbi->s_locality_groups = alloc_percpu(struct ext4_locality_group);
2618 if (sbi->s_locality_groups == NULL) { 2618 if (sbi->s_locality_groups == NULL) {
2619 ret = -ENOMEM; 2619 ret = -ENOMEM;
2620 goto out_free_groupinfo_slab; 2620 goto out;
2621 } 2621 }
2622 for_each_possible_cpu(i) { 2622 for_each_possible_cpu(i) {
2623 struct ext4_locality_group *lg; 2623 struct ext4_locality_group *lg;
@@ -2642,8 +2642,6 @@ int ext4_mb_init(struct super_block *sb)
2642out_free_locality_groups: 2642out_free_locality_groups:
2643 free_percpu(sbi->s_locality_groups); 2643 free_percpu(sbi->s_locality_groups);
2644 sbi->s_locality_groups = NULL; 2644 sbi->s_locality_groups = NULL;
2645out_free_groupinfo_slab:
2646 ext4_groupinfo_destroy_slabs();
2647out: 2645out:
2648 kfree(sbi->s_mb_offsets); 2646 kfree(sbi->s_mb_offsets);
2649 sbi->s_mb_offsets = NULL; 2647 sbi->s_mb_offsets = NULL;