Skip to contentSkip to conversation

ocfs2: Remove pointless assignment in ocfs2_init()

PATCH New Jan Kara 2 participants 3 messages Oct 21, 2014 – Nov 6, 2014 OCFS2

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 ocfs2: Remove pointless assignment in ocfs2_init()

Remove assignment which is never used.

Coverity-id: 1227009

---
 fs/ocfs2/super.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/ocfs2/super.c +1 -3
index 93c85bc745e1..e1be0f0ea411 100644
@@ -1621,10 +1621,8 @@ static int __init ocfs2_init(void)
 	}
 
 	ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL);
-	if (!ocfs2_debugfs_root) {
-		status = -EFAULT;
+	if (!ocfs2_debugfs_root)
 		mlog(ML_ERROR, "Unable to create ocfs2 debugfs root.\n");
-	}
 
 	ocfs2_set_locking_protocol();
 
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 ocfs2: Remove pointless assignment in ocfs2_init()

Does it mean we can ignore the failure of creating debugfs?

Quoted 25 lines · Jan Kara

Remove assignment which is never used.

Coverity-id: 1227009

---
 fs/ocfs2/super.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/ocfs2/super.c +1 -3
index 93c85bc745e1..e1be0f0ea411 100644
@@ -1621,10 +1621,8 @@ static int __init ocfs2_init(void)
 	}
 
 	ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL);
-	if (!ocfs2_debugfs_root) {
-		status = -EFAULT;
+	if (!ocfs2_debugfs_root)
 		mlog(ML_ERROR, "Unable to create ocfs2 debugfs root.\n");
-	}
 
 	ocfs2_set_locking_protocol();
 
author
#2 lore raw

PATCH 1/1 ocfs2: Remove pointless assignment in ocfs2_init()

Quoted 1 line · Joseph Qi

Does it mean we can ignore the failure of creating debugfs?

Yes, generally it's the case that debugfs is optional and filesystem can
function without it just fine. OTOH looking more into where ocfs2_debugfs_root is used, failure to create ocfs2_debugfs_root will lead to debugfs entries being created in the root directory of debugfs filesystem which is confusing to say the least. So for simplicity it's probably better to just bail out with ENOMEM when we fail to create the root. I'll send an updated patch. Thanks for review!

Honza

Quoted 29 lines · Jan Kara
Quoted 25 lines

Remove assignment which is never used.

Coverity-id: 1227009

---
 fs/ocfs2/super.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/ocfs2/super.c +1 -3
index 93c85bc745e1..e1be0f0ea411 100644
@@ -1621,10 +1621,8 @@ static int __init ocfs2_init(void)
 	}
 
 	ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL);
-	if (!ocfs2_debugfs_root) {
-		status = -EFAULT;
+	if (!ocfs2_debugfs_root)
 		mlog(ML_ERROR, "Unable to create ocfs2 debugfs root.\n");
-	}
 
 	ocfs2_set_locking_protocol();
 
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR