From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiro SEKIBA Subject: [PATCH] nilfs2-utils: fix bug when opening non-nilfs2 device Date: Fri, 10 Sep 2010 18:33:25 +0900 Message-ID: <87vd6ec596.wl%jir@sekiba.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Return-path: Sender: linux-nilfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Ryusuke Konishi , Ryusuke Konishi 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. Signed-off-by: Jiro SEKIBA --- lib/sb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/sb.c b/lib/sb.c index 201b9ad..b60575d 100644 --- a/lib/sb.c +++ b/lib/sb.c @@ -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]; -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html