Skip to content

Commit d44651d

Browse files
Fabrice Jouhaudtytso
authored andcommitted
ext4: fix ext4 so it works without CONFIG_PROC_FS
This fixes a bug which was introduced in dd68314. The problem came from the test of the return value of proc_mkdir which is always false without procfs, and this would initialization of ext4. Signed-off-by: Fabrice Jouhaud <yargil@free.fr> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent 6ee3b21 commit d44651d

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

‎fs/ext4/super.c‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3540,10 +3540,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
35403540
goto failed_mount;
35413541
}
35423542

3543-
#ifdef CONFIG_PROC_FS
35443543
if (ext4_proc_root)
35453544
sbi->s_proc = proc_mkdir(sb->s_id, ext4_proc_root);
3546-
#endif
35473545

35483546
bgl_lock_init(sbi->s_blockgroup_lock);
35493547

@@ -5070,13 +5068,11 @@ static int __init ext4_init_fs(void)
50705068
return err;
50715069
err = ext4_init_system_zone();
50725070
if (err)
5073-
goto out7;
5071+
goto out6;
50745072
ext4_kset = kset_create_and_add("ext4", NULL, fs_kobj);
50755073
if (!ext4_kset)
5076-
goto out6;
5077-
ext4_proc_root = proc_mkdir("fs/ext4", NULL);
5078-
if (!ext4_proc_root)
50795074
goto out5;
5075+
ext4_proc_root = proc_mkdir("fs/ext4", NULL);
50805076

50815077
err = ext4_init_feat_adverts();
50825078
if (err)
@@ -5112,12 +5108,12 @@ static int __init ext4_init_fs(void)
51125108
out3:
51135109
ext4_exit_feat_adverts();
51145110
out4:
5115-
remove_proc_entry("fs/ext4", NULL);
5116-
out5:
5111+
if (ext4_proc_root)
5112+
remove_proc_entry("fs/ext4", NULL);
51175113
kset_unregister(ext4_kset);
5118-
out6:
5114+
out5:
51195115
ext4_exit_system_zone();
5120-
out7:
5116+
out6:
51215117
ext4_exit_pageio();
51225118
return err;
51235119
}

0 commit comments

Comments
 (0)