linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 2/4] fsck.f2fs: fix superblock offset
Date: Wed, 15 Oct 2014 20:59:09 -0700	[thread overview]
Message-ID: <1413431951-27137-2-git-send-email-jaegeuk@kernel.org> (raw)
In-Reply-To: <1413431951-27137-1-git-send-email-jaegeuk@kernel.org>

The second offset should be F2FS_BLKSIZE + F2FS_SUPER_OFFSET.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 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

  reply	other threads:[~2014-10-16  3:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16  3:59 [PATCH 1/4] mkfs.f2fs: avoid build warning Jaegeuk Kim
2014-10-16  3:59 ` Jaegeuk Kim [this message]
2014-10-16  3:59 ` [PATCH 3/4] fsck.f2fs: support inline_dentry Jaegeuk Kim
2014-10-16  3:59 ` [PATCH 4/4] fsck.f2fs: fix wrong hash_code made by previous buggy code Jaegeuk Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1413431951-27137-2-git-send-email-jaegeuk@kernel.org \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).