From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaegeuk Kim Subject: [PATCH 2/4] fsck.f2fs: fix superblock offset Date: Wed, 15 Oct 2014 20:59:09 -0700 Message-ID: <1413431951-27137-2-git-send-email-jaegeuk@kernel.org> References: <1413431951-27137-1-git-send-email-jaegeuk@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XecDi-0003Ww-Uf for linux-f2fs-devel@lists.sourceforge.net; Thu, 16 Oct 2014 03:59:22 +0000 Received: from mail.kernel.org ([198.145.19.201]) by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1XecDi-0007mf-7f for linux-f2fs-devel@lists.sourceforge.net; Thu, 16 Oct 2014 03:59:22 +0000 In-Reply-To: <1413431951-27137-1-git-send-email-jaegeuk@kernel.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim The second offset should be F2FS_BLKSIZE + F2FS_SUPER_OFFSET. Signed-off-by: Jaegeuk Kim --- fsck/mount.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fsck/mount.c b/fsck/mount.c index 415f977..8b39d37 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -223,9 +223,14 @@ int sanity_check_raw_super(struct f2fs_super_block *raw_super) int validate_super_block(struct f2fs_sb_info *sbi, int block) { - u64 offset = (block + 1) * F2FS_SUPER_OFFSET; + u64 offset; sbi->raw_super = malloc(sizeof(struct f2fs_super_block)); + if (block == 0) + offset = F2FS_SUPER_OFFSET; + else + offset = F2FS_BLKSIZE + F2FS_SUPER_OFFSET; + if (dev_read(sbi->raw_super, offset, sizeof(struct f2fs_super_block))) return -1; -- 2.1.1 ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho