* [Ocfs2-devel] [PATCH] ocfs2: Fix error handling when creating debugfs root in ocfs2_init()
@ 2014-11-06 7:07 Jan Kara
2014-11-06 7:37 ` Joseph Qi
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2014-11-06 7:07 UTC (permalink / raw)
To: ocfs2-devel
Error handling if creation of root of debugfs in ocfs2_init() fails is
broken. Although error code is set we fail to exit ocfs2_init() with
error and thus initialization ends with success. Later when mounting a
filesystem, ocfs2 debugfs entries end up being created in the root of
debugfs filesystem which is confusing.
Fix the error handling to bail out.
Coverity-id: 1227009
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/ocfs2/super.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
This replaces patch "ocfs2: Remove pointless assignment in ocfs2_init()".
Things are safer this way and when debugfs dir creation fails, something is
really wrong.
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 93c85bc745e1..8e3ac25efb9f 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1622,8 +1622,9 @@ static int __init ocfs2_init(void)
ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL);
if (!ocfs2_debugfs_root) {
- status = -EFAULT;
+ status = -ENOMEM;
mlog(ML_ERROR, "Unable to create ocfs2 debugfs root.\n");
+ goto out4;
}
ocfs2_set_locking_protocol();
--
1.8.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: Fix error handling when creating debugfs root in ocfs2_init()
2014-11-06 7:07 [Ocfs2-devel] [PATCH] ocfs2: Fix error handling when creating debugfs root in ocfs2_init() Jan Kara
@ 2014-11-06 7:37 ` Joseph Qi
0 siblings, 0 replies; 2+ messages in thread
From: Joseph Qi @ 2014-11-06 7:37 UTC (permalink / raw)
To: ocfs2-devel
Looks good to me. Thanks.
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
On 2014/11/6 15:07, Jan Kara wrote:
> Error handling if creation of root of debugfs in ocfs2_init() fails is
> broken. Although error code is set we fail to exit ocfs2_init() with
> error and thus initialization ends with success. Later when mounting a
> filesystem, ocfs2 debugfs entries end up being created in the root of
> debugfs filesystem which is confusing.
>
> Fix the error handling to bail out.
>
> Coverity-id: 1227009
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
> fs/ocfs2/super.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> This replaces patch "ocfs2: Remove pointless assignment in ocfs2_init()".
> Things are safer this way and when debugfs dir creation fails, something is
> really wrong.
>
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index 93c85bc745e1..8e3ac25efb9f 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -1622,8 +1622,9 @@ static int __init ocfs2_init(void)
>
> ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL);
> if (!ocfs2_debugfs_root) {
> - status = -EFAULT;
> + status = -ENOMEM;
> mlog(ML_ERROR, "Unable to create ocfs2 debugfs root.\n");
> + goto out4;
> }
>
> ocfs2_set_locking_protocol();
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-06 7:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-06 7:07 [Ocfs2-devel] [PATCH] ocfs2: Fix error handling when creating debugfs root in ocfs2_init() Jan Kara
2014-11-06 7:37 ` Joseph Qi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.