* [PATCH] fs: proc: check status of register_filesystem
@ 2018-12-26 3:06 Kangjie Lu
2018-12-26 6:18 ` Alexey Dobriyan
2019-01-02 9:38 ` David Howells
0 siblings, 2 replies; 5+ messages in thread
From: Kangjie Lu @ 2018-12-26 3:06 UTC (permalink / raw)
To: kjlu
Cc: pakki001, Alexey Dobriyan, Andrew Morton, Davidlohr Bueso,
David Howells, linux-kernel, linux-fsdevel
register_filesystem() could fail. The fix issues an error message if it
fails.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
fs/proc/root.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/proc/root.c b/fs/proc/root.c
index f4b1a9d2eca6..7dcd947cba23 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -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,
--
2.17.2 (Apple Git-113)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] fs: proc: check status of register_filesystem
2018-12-26 3:06 [PATCH] fs: proc: check status of register_filesystem Kangjie Lu
@ 2018-12-26 6:18 ` Alexey Dobriyan
2018-12-26 6:58 ` Al Viro
2019-01-02 9:38 ` David Howells
2019-01-02 9:38 ` David Howells
1 sibling, 2 replies; 5+ messages in thread
From: Alexey Dobriyan @ 2018-12-26 6:18 UTC (permalink / raw)
To: Kangjie Lu
Cc: pakki001, Andrew Morton, Davidlohr Bueso, David Howells,
linux-kernel, linux-fsdevel
On Tue, Dec 25, 2018 at 09:06:40PM -0600, Kangjie Lu wrote:
> register_filesystem() could fail. The fix issues an error message if it
> fails.
> - 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fs: proc: check status of register_filesystem
2018-12-26 6:18 ` Alexey Dobriyan
@ 2018-12-26 6:58 ` Al Viro
2019-01-02 9:38 ` David Howells
1 sibling, 0 replies; 5+ messages in thread
From: Al Viro @ 2018-12-26 6:58 UTC (permalink / raw)
To: Alexey Dobriyan
Cc: Kangjie Lu, pakki001, Andrew Morton, Davidlohr Bueso,
David Howells, linux-kernel, linux-fsdevel
On Wed, Dec 26, 2018 at 09:18:56AM +0300, Alexey Dobriyan wrote:
> On Tue, Dec 25, 2018 at 09:06:40PM -0600, Kangjie Lu wrote:
> > register_filesystem() could fail. The fix issues an error message if it
> > fails.
>
> > - 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().
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fs: proc: check status of register_filesystem
2018-12-26 3:06 [PATCH] fs: proc: check status of register_filesystem Kangjie Lu
2018-12-26 6:18 ` Alexey Dobriyan
@ 2019-01-02 9:38 ` David Howells
1 sibling, 0 replies; 5+ messages in thread
From: David Howells @ 2019-01-02 9:38 UTC (permalink / raw)
To: Kangjie Lu
Cc: dhowells, pakki001, Alexey Dobriyan, Andrew Morton,
Davidlohr Bueso, linux-kernel, linux-fsdevel
Kangjie Lu <kjlu@umn.edu> wrote:
> + pr_err("failed to register the filesystem.\n");
Is it worth saying which filesystem?
David
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fs: proc: check status of register_filesystem
2018-12-26 6:18 ` Alexey Dobriyan
2018-12-26 6:58 ` Al Viro
@ 2019-01-02 9:38 ` David Howells
1 sibling, 0 replies; 5+ messages in thread
From: David Howells @ 2019-01-02 9:38 UTC (permalink / raw)
To: Alexey Dobriyan
Cc: dhowells, Kangjie Lu, pakki001, Andrew Morton, Davidlohr Bueso,
linux-kernel, linux-fsdevel
Alexey Dobriyan <adobriyan@gmail.com> wrote:
> > - 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-01-02 9:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-26 3:06 [PATCH] fs: proc: check status of register_filesystem Kangjie Lu
2018-12-26 6:18 ` Alexey Dobriyan
2018-12-26 6:58 ` Al Viro
2019-01-02 9:38 ` David Howells
2019-01-02 9:38 ` David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox