Skip to contentSkip to conversation

nilfs2-utils: fix bug when opening non-nilfs2 device

PATCH Applied Jiro SEKIBA 2 participants 2 messages Sep 10, 2010 – Sep 11, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nilfs2-utils: fix bug when opening non-nilfs2 device

Hi,

This patch fixes a wrong return value of nilfs_sb_read when opening non-nilfs2 device. nilfs_sb_read should return NULL in case it was not a nilfs2 device instead of "-1" to indicate error.

---
 lib/sb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/sb.c +1 -1
index 201b9ad..b60575d 100644
@@ -161,7 +161,7 @@ struct nilfs_super_block *nilfs_sb_read(int devfd)
 	struct nilfs_super_block *sbp[2];
 
 	if (__nilfs_sb_read(devfd, sbp, NULL))
-		return -1;
+		return NULL;
 
 	if (!sbp[0]) {
 		sbp[0] = sbp[1];
Signature · 6 lines
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 87vd6ec596.wl%[email protected]

#2 lore raw
Quoted 7 lines · Jiro SEKIBA

Hi,

This patch fixes a wrong return value of nilfs_sb_read when opening non-nilfs2 device. nilfs_sb_read should return NULL in case it was not a nilfs2 device instead of "-1" to indicate error.

Applied, thank you.

Ryusuke Konishi

Quoted 20 lines
---
 lib/sb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/sb.c +1 -1
index 201b9ad..b60575d 100644
@@ -161,7 +161,7 @@ struct nilfs_super_block *nilfs_sb_read(int devfd)
 	struct nilfs_super_block *sbp[2];
 
 	if (__nilfs_sb_read(devfd, sbp, NULL))
-		return -1;
+		return NULL;
 
 	if (!sbp[0]) {
 		sbp[0] = sbp[1];
Signature · 1 line
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html