Skip to contentSkip to conversation

ext4: return actual error on ext4_init_fs

PATCH Applied Jeff Liu 2 participants 2 messages Jun 17, 2014 ext4 file system

lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH 20/24 ext4: return actual error on ext4_init_fs

From: Jie Liu <[email protected]>

Return the actual error code if call kset_create_and_add() failed

Cc Theodore Ts'o <[email protected]>
Cc Andreas Dilger <[email protected]>
---
 fs/ext4/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext4/super.c +2 -2
index b9b9aab..5912193 100644
@@ -5545,8 +5545,8 @@ static int __init ext4_init_fs(void)
 	if (err)
 		goto out6;
 	ext4_kset = kset_create_and_add("ext4", NULL, fs_kobj);
-	if (!ext4_kset) {
-		err = -ENOMEM;
+	if (IS_ERR(ext4_kset)) {
+		err = PTR_ERR(ext4_kset);
 		goto out5;
 	}
 	ext4_proc_root = proc_mkdir("fs/ext4", NULL);
Signature · 1 line
1.8.3.2
Reviewed-by on v1 20/24
#1 lore raw
Quoted 9 lines · Jeff Liu

Date: Tue, 17 Jun 2014 22:32:54 +0800
From: Jeff Liu <[email protected]>
To: Theodore Ts'o <[email protected]>, Andreas Dilger <[email protected]>
Cc: [email protected]
Subject: [PATCH 20/24] ext4: return actual error on ext4_init_fs

From: Jie Liu <[email protected]>

Return the actual error code if call kset_create_and_add() failed

Considering the rest of the series this looks good to me. Thanks!

Quoted 24 lines
Cc Theodore Ts'o <[email protected]>
Cc Andreas Dilger <[email protected]>
---
 fs/ext4/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext4/super.c +2 -2
index b9b9aab..5912193 100644
@@ -5545,8 +5545,8 @@ static int __init ext4_init_fs(void)
 	if (err)
 		goto out6;
 	ext4_kset = kset_create_and_add("ext4", NULL, fs_kobj);
-	if (!ext4_kset) {
-		err = -ENOMEM;
+	if (IS_ERR(ext4_kset)) {
+		err = PTR_ERR(ext4_kset);
 		goto out5;
 	}
 	ext4_proc_root = proc_mkdir("fs/ext4", NULL);