aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-02-03 14:33:49 -0500
committerTheodore Ts'o <tytso@mit.edu>2011-02-03 14:33:49 -0500
commitdd68314ccf3fb918c1fb6471817edbc60ece4b52 (patch)
tree9faa6b90bfafcd3dbaac1df206df7f56e537030e /fs/ext4
parent8f021222c1e2756ea4c9dde93b23e1d2a0a4ec37 (diff)
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>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 4898cb1ff606..86b05486dc63 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4810,13 +4810,17 @@ static int __init ext4_init_fs(void)
4810 return err; 4810 return err;
4811 err = ext4_init_system_zone(); 4811 err = ext4_init_system_zone();
4812 if (err) 4812 if (err)
4813 goto out5; 4813 goto out7;
4814 ext4_kset = kset_create_and_add("ext4", NULL, fs_kobj); 4814 ext4_kset = kset_create_and_add("ext4", NULL, fs_kobj);
4815 if (!ext4_kset) 4815 if (!ext4_kset)
4816 goto out4; 4816 goto out6;
4817 ext4_proc_root = proc_mkdir("fs/ext4", NULL); 4817 ext4_proc_root = proc_mkdir("fs/ext4", NULL);
4818 if (!ext4_proc_root)
4819 goto out5;
4818 4820
4819 err = ext4_init_feat_adverts(); 4821 err = ext4_init_feat_adverts();
4822 if (err)
4823 goto out4;
4820 4824
4821 err = ext4_init_mballoc(); 4825 err = ext4_init_mballoc();
4822 if (err) 4826 if (err)
@@ -4847,11 +4851,13 @@ out2:
4847 ext4_exit_mballoc(); 4851 ext4_exit_mballoc();
4848out3: 4852out3:
4849 ext4_exit_feat_adverts(); 4853 ext4_exit_feat_adverts();
4854out4:
4850 remove_proc_entry("fs/ext4", NULL); 4855 remove_proc_entry("fs/ext4", NULL);
4856out5:
4851 kset_unregister(ext4_kset); 4857 kset_unregister(ext4_kset);
4852out4: 4858out6:
4853 ext4_exit_system_zone(); 4859 ext4_exit_system_zone();
4854out5: 4860out7:
4855 ext4_exit_pageio(); 4861 ext4_exit_pageio();
4856 return err; 4862 return err;
4857} 4863}