nilfs2-utils: fix bug when opening non-nilfs2 device
Subsystems (2)
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
@@ -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]
Ryusuke Konishi
AppliedQuoted 7 lines · Jiro SEKIBA
Hi,
This patch fixes a wrong return value of
nilfs_sb_readwhen opening non-nilfs2 device.nilfs_sb_readshould return NULL in case it was not a nilfs2 device instead of "-1" to indicate error.Signed-off-by Jiro SEKIBA <[email protected]>
Applied, thank you.
Ryusuke Konishi
Quoted 20 lines
--- lib/sb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)lib/sb.c +1
-1@@ -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