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/2] fsck.f2fs: check nat_bits separately from bug_on
Date: Wed, 28 Nov 2018 18:03:42 -0800	[thread overview]
Message-ID: <20181129020342.96045-2-jaegeuk@kernel.org> (raw)
In-Reply-To: <20181129020342.96045-1-jaegeuk@kernel.org>

It checks nat_bits separately, and enable it seamlessly.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fsck/fsck.c       | 2 +-
 fsck/mount.c      | 2 +-
 include/f2fs_fs.h | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index bcda781..e089a64 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -2676,7 +2676,7 @@ int fsck_verify(struct f2fs_sb_info *sbi)
 	if (force || (c.fix_on && !c.ro)) {
 		struct f2fs_checkpoint *cp = F2FS_CKPT(sbi);
 
-		if (force || c.bug_on) {
+		if (force || c.bug_on || c.bug_nat_bits) {
 			/* flush nats to write_nit_bits below */
 			flush_journal_entries(sbi);
 			fix_hard_links(sbi);
diff --git a/fsck/mount.c b/fsck/mount.c
index d853fcf..3966525 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -1242,7 +1242,7 @@ out:
 	if (!err) {
 		MSG(0, "Info: Checked valid nat_bits in checkpoint\n");
 	} else {
-		c.bug_on = 1;
+		c.bug_nat_bits = 1;
 		MSG(0, "Info: Corrupted valid nat_bits in checkpoint\n");
 	}
 	return err;
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index 6eebb3a..a730688 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -372,6 +372,7 @@ struct f2fs_configuration {
 	int force;
 	int defset;
 	int bug_on;
+	int bug_nat_bits;
 	int alloc_failed;
 	int auto_fix;
 	int quota_fix;
-- 
2.19.0.605.g01d371f741-goog

  reply	other threads:[~2018-11-29  2:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29  2:03 [PATCH 1/2] tools: add f2fs_io Jaegeuk Kim
2018-11-29  2:03 ` Jaegeuk Kim [this message]
2018-11-30  3:29   ` [PATCH 2/2] fsck.f2fs: check nat_bits separately from bug_on Chao Yu
2018-11-30  3:23 ` [PATCH 1/2] tools: add f2fs_io Chao Yu

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=20181129020342.96045-2-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).