Skip to content

Commit dd68314

Browse files
committed
ext4: fix up ext4 error handling
Make sure we the correct cleanup happens if we die while trying to load the ext4 file system. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent 8f02122 commit dd68314

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎fs/ext4/super.c‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4810,13 +4810,17 @@ static int __init ext4_init_fs(void)
48104810
return err;
48114811
err = ext4_init_system_zone();
48124812
if (err)
4813-
goto out5;
4813+
goto out7;
48144814
ext4_kset = kset_create_and_add("ext4", NULL, fs_kobj);
48154815
if (!ext4_kset)
4816-
goto out4;
4816+
goto out6;
48174817
ext4_proc_root = proc_mkdir("fs/ext4", NULL);
4818+
if (!ext4_proc_root)
4819+
goto out5;
48184820

48194821
err = ext4_init_feat_adverts();
4822+
if (err)
4823+
goto out4;
48204824

48214825
err = ext4_init_mballoc();
48224826
if (err)
@@ -4847,11 +4851,13 @@ static int __init ext4_init_fs(void)
48474851
ext4_exit_mballoc();
48484852
out3:
48494853
ext4_exit_feat_adverts();
4854+
out4:
48504855
remove_proc_entry("fs/ext4", NULL);
4856+
out5:
48514857
kset_unregister(ext4_kset);
4852-
out4:
4858+
out6:
48534859
ext4_exit_system_zone();
4854-
out5:
4860+
out7:
48554861
ext4_exit_pageio();
48564862
return err;
48574863
}

0 commit comments

Comments
 (0)