Linux-f2fs-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: He YunLei <heyunlei@huawei.com>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] f2fs: add a segment and section num check in sanity_check_raw_super
Date: Mon, 28 Dec 2015 15:10:56 -0800	[thread overview]
Message-ID: <20151228231056.GA65529@jaegeuk.local> (raw)
In-Reply-To: <567E01B1.5090207@huawei.com>

Hi Yunlei,

On Sat, Dec 26, 2015 at 10:55:45AM +0800, He YunLei wrote:
> On 2015/12/26 10:46, Yunlei He wrote:
> >This patch add a mismatch check between segment and section in
> >sanity_check_raw_super.
> >
> >Signed-off-by: Yunlei He <heyunlei@huawei.com>
> >---
> >  fs/f2fs/super.c | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> >diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> >index c3070c1..b51a690 100644
> >--- a/fs/f2fs/super.c
> >+++ b/fs/f2fs/super.c
> >@@ -1036,6 +1036,17 @@ static int sanity_check_raw_super(struct super_block *sb,
> >  		return 1;
> >  	}
> >
> >+	/* check seg # corresponding to sec # */
> >+	if (le32_to_cpu(raw_super->segment_count)

			raw_super->segment_count_main ?

Thanks,

> >+			* le32_to_cpu(raw_super->segs_per_sec)
> 
> I am sorry that here is :
> 			/ le32_to_cpu(raw_super->segs_per_sec)
> >+				!= le32_to_cpu(raw_super->section_count)) {
> >+		f2fs_msg(sb, KERN_INFO,
> >+			"Mismatch seg num (%u) and sec num (%u) \n",
> >+			le32_to_cpu(raw_super->segment_count),
> >+			le32_to_cpu(raw_super->section_count));
> >+		return 1;
> >+	}
> >+
> >  	/* Currently, support 512/1024/2048/4096 bytes sector size */
> >  	if (le32_to_cpu(raw_super->log_sectorsize) >
> >  				F2FS_MAX_LOG_SECTOR_SIZE ||
> >

------------------------------------------------------------------------------

  reply	other threads:[~2015-12-28 23:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-26  2:46 [PATCH] f2fs: add a segment and section num check in sanity_check_raw_super Yunlei He
2015-12-26  2:55 ` He YunLei
2015-12-28 23:10   ` Jaegeuk Kim [this message]
2015-12-29  0:58     ` He YunLei
2015-12-29  1:46       ` Jaegeuk Kim
2015-12-31  1:02         ` He YunLei

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=20151228231056.GA65529@jaegeuk.local \
    --to=jaegeuk@kernel.org \
    --cc=heyunlei@huawei.com \
    --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