From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: tytso@mit.edu, darrick.wong@oracle.com
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH 3/9] e2fsck: check the checksum seed feature flag is set correctly
Date: Sat, 13 Feb 2016 14:37:44 -0800 [thread overview]
Message-ID: <20160213223744.25381.96382.stgit@birch.djwong.org> (raw)
In-Reply-To: <20160213223725.25381.20929.stgit@birch.djwong.org>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
e2fsck/problem.c | 5 +++++
e2fsck/problem.h | 3 +++
e2fsck/super.c | 9 +++++++++
3 files changed, 17 insertions(+)
diff --git a/e2fsck/problem.c b/e2fsck/problem.c
index a7da94d..971b0ad 100644
--- a/e2fsck/problem.c
+++ b/e2fsck/problem.c
@@ -467,6 +467,11 @@ static struct e2fsck_problem problem_table[] = {
N_("External @j @S checksum does not match @S. "),
PROMPT_FIX, PR_PREEN_OK },
+ /* metadata_csum_seed means nothing without metadata_csum */
+ { PR_0_CSUM_SEED_WITHOUT_META_CSUM,
+ N_("@S metadata_csum_seed is not necessary without metadata_csum."),
+ PROMPT_FIX, PR_PREEN_OK | PR_NO_OK},
+
/* Pass 1 errors */
/* Pass 1: Checking inodes, blocks, and sizes */
diff --git a/e2fsck/problem.h b/e2fsck/problem.h
index 3b92e41..b3f5b8f 100644
--- a/e2fsck/problem.h
+++ b/e2fsck/problem.h
@@ -268,6 +268,9 @@ struct problem_context {
/* External journal has corrupt superblock */
#define PR_0_EXT_JOURNAL_SUPER_CSUM_INVALID 0x00004A
+/* metadata_csum_seed means nothing without metadata_csum */
+#define PR_0_CSUM_SEED_WITHOUT_META_CSUM 0x00004B
+
/*
* Pass 1 errors
*/
diff --git a/e2fsck/super.c b/e2fsck/super.c
index af6d680..e09c14c 100644
--- a/e2fsck/super.c
+++ b/e2fsck/super.c
@@ -589,6 +589,15 @@ void check_super_block(e2fsck_t ctx)
ext2fs_group_desc_csum_set(fs, i);
}
+ /* We can't have ^metadata_csum,metadata_csum_seed */
+ if (!ext2fs_has_feature_metadata_csum(fs->super) &&
+ ext2fs_has_feature_csum_seed(fs->super) &&
+ fix_problem(ctx, PR_0_CSUM_SEED_WITHOUT_META_CSUM, &pctx)) {
+ ext2fs_clear_feature_csum_seed(fs->super);
+ fs->super->s_checksum_seed = 0;
+ ext2fs_mark_super_dirty(fs);
+ }
+
/* Is 64bit set and extents unset? */
if (ext2fs_has_feature_64bit(fs->super) &&
!ext2fs_has_feature_extents(fs->super) &&
next prev parent reply other threads:[~2016-02-13 22:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-13 22:37 [PATCH 0/9] e2fsprogs: save checksum seeds; fix broken xattr editing; misc fixes Darrick J. Wong
2016-02-13 22:37 ` [PATCH 1/9] libext2fs: store checksum seed in superblock Darrick J. Wong
2016-03-05 23:21 ` Theodore Ts'o
2016-02-13 22:37 ` [PATCH 2/9] tune2fs: allow user to turn on saving the checksum seed Darrick J. Wong
2016-03-05 23:36 ` Theodore Ts'o
2016-02-13 22:37 ` Darrick J. Wong [this message]
2016-03-05 23:37 ` [PATCH 3/9] e2fsck: check the checksum seed feature flag is set correctly Theodore Ts'o
2016-02-13 22:37 ` [PATCH 4/9] mke2fs: store checksum seed at format time Darrick J. Wong
2016-03-06 0:19 ` Theodore Ts'o
2016-02-13 22:37 ` [PATCH 5/9] tests: check proper operation of metadata_csum_seed Darrick J. Wong
2016-03-06 0:20 ` Theodore Ts'o
2016-02-13 22:38 ` [PATCH 6/9] filefrag: accommodate holes when calculating expected values Darrick J. Wong
2016-03-06 2:41 ` Theodore Ts'o
2016-02-13 22:38 ` [PATCH 7/9] tune2fs: confirm dangerous operations Darrick J. Wong
2016-02-15 0:49 ` Andreas Dilger
2016-02-15 16:53 ` Darrick J. Wong
2016-03-06 5:10 ` Theodore Ts'o
2016-03-06 6:24 ` Darrick J. Wong
2016-02-13 22:38 ` [PATCH 8/9] tune2fs: recover the journal Darrick J. Wong
2016-03-06 5:23 ` Theodore Ts'o
2016-02-13 22:38 ` [PATCH 9/9] libext2fs: sort keys for xattr blocks Darrick J. Wong
2016-02-14 10:37 ` Richard Purdie
2016-03-06 3:55 ` Theodore Ts'o
2016-03-06 22:08 ` Darrick J. Wong
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=20160213223744.25381.96382.stgit@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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).