Skip to content

Commit 1539d58

Browse files
Alexey Dobriyantorvalds
authored andcommitted
proc: register filesystem last
As soon as register_filesystem() exits, filesystem can be mounted. It is better to present fully operational /proc. Of course it doesn't matter because /proc is not modular but do it anyway. Drop error check, it should be handled by panicking. Link: http://lkml.kernel.org/r/20180309222709.GA3843@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 35318db commit 1539d58

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎fs/proc/root.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,8 @@ static struct file_system_type proc_fs_type = {
123123

124124
void __init proc_root_init(void)
125125
{
126-
int err;
127-
128126
proc_init_kmemcache();
129127
set_proc_pid_nlink();
130-
err = register_filesystem(&proc_fs_type);
131-
if (err)
132-
return;
133-
134128
proc_self_init();
135129
proc_thread_self_init();
136130
proc_symlink("mounts", NULL, "self/mounts");
@@ -146,6 +140,8 @@ void __init proc_root_init(void)
146140
proc_tty_init();
147141
proc_mkdir("bus", NULL);
148142
proc_sys_init();
143+
144+
register_filesystem(&proc_fs_type);
149145
}
150146

151147
static int proc_root_getattr(const struct path *path, struct kstat *stat,

0 commit comments

Comments
 (0)