fs: proc: check status of register_filesystem
Subsystems (2)
PATCH 1/1 fs: proc: check status of register_filesystem
register_filesystem() could fail. The fix issues an error message if it fails.
--- fs/proc/root.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/proc/root.c +2 -1
@@ -141,7 +141,8 @@ void __init proc_root_init(void)proc_mkdir ("bus" ,NULL );proc_sys_init (); -register_filesystem (&proc_fs_type); +if (register_filesystem (&proc_fs_type)) +pr_err ("failed to register the filesystem.\n" ); } static int proc_root_getattr(const struct path *path, struct kstat *stat,
Signature · 1 line
2.17.2 (Apple Git-113)
fs/proc/root.c void __init proc_root_init(void) · line 145
Quoted 6 lines · Kangjie Lu
register_filesystem()could fail. The fix issues an error message if it fails.fs/proc/root.c +2
-1-register_filesystem (&proc_fs_type); +if (register_filesystem (&proc_fs_type)) +pr_err ("failed to register the filesystem.\n" );
No, register_filesystem() should do it.
Al Viro
maintainerQuoted 9 lines · Alexey Dobriyan
fs/proc/root.c void __init proc_root_init(void) · line 145
Quoted 6 lines · Kangjie Lu
register_filesystem()could fail. The fix issues an error message if it fails.fs/proc/root.c +2
-1-register_filesystem (&proc_fs_type); +if (register_filesystem (&proc_fs_type)) +pr_err ("failed to register the filesystem.\n" );No,
register_filesystem()should do it.
Folks, check when would it fail. If we have something called "proc" already registered by the time when proc_root_init() runs... might as well have been a panic().
Quoted 5 lines · Alexey Dobriyan
fs/proc/root.c void __init proc_root_init(void) · line 145
Quoted 3 lines
fs/proc/root.c +2
-1-register_filesystem (&proc_fs_type); +if (register_filesystem (&proc_fs_type)) +pr_err ("failed to register the filesystem.\n" );No,
register_filesystem()should do it.
+1
David
fs/proc/root.c void __init proc_root_init(void) · line 145
Quoted 1 line · Kangjie Lu
fs/proc/root.c +1
-0+pr_err ("failed to register the filesystem.\n" );
Is it worth saying which filesystem?
David