2013-08-23 00:30:24

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH -next] f2fs: fix error return code in init_f2fs_fs()

From: Wei Yongjun <[email protected]>

Fix to return -ENOMEM in the kset create and add error handling
case instead of 0, as done elsewhere in this function.

Introduced by commit b59d0bae6ca30c496f298881616258f9cde0d9c6.
(f2fs: add sysfs support for controlling the gc_thread)

Signed-off-by: Wei Yongjun <[email protected]>
---
fs/f2fs/super.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 66d1ec1..33a809f 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1013,8 +1013,10 @@ static int __init init_f2fs_fs(void)
if (err)
goto fail;
f2fs_kset = kset_create_and_add("f2fs", NULL, fs_kobj);
- if (!f2fs_kset)
+ if (!f2fs_kset) {
+ err = -ENOMEM;
goto fail;
+ }
err = register_filesystem(&f2fs_fs_type);
if (err)
goto fail;


2013-08-23 07:44:27

by Namjae Jeon

[permalink] [raw]
Subject: Re: [PATCH -next] f2fs: fix error return code in init_f2fs_fs()

2013/8/23, Wei Yongjun <[email protected]>:
> From: Wei Yongjun <[email protected]>
>
> Fix to return -ENOMEM in the kset create and add error handling
> case instead of 0, as done elsewhere in this function.
>
> Introduced by commit b59d0bae6ca30c496f298881616258f9cde0d9c6.
> (f2fs: add sysfs support for controlling the gc_thread)
>
> Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Namjae Jeon <[email protected]>