* [PATCH] jbd2: fix regression where we fail to initialize checksum seed when loading
@ 2014-12-02 0:22 Darrick J. Wong
2014-12-02 3:05 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Darrick J. Wong @ 2014-12-02 0:22 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: linux-ext4, Eric Whitney
When we're enabling journal features, we cannot use the predicate
jbd2_journal_has_csum_v2or3() because we haven't yet set the sb
feature flag fields! Moreover, we just finished loading the shash
driver, so the test is unnecessary; calculate the seed always.
Without this patch, we fail to initialize the checksum seed the first
time we turn on journal_checksum, which means that all journal blocks
written during that first mount are corrupt. Transactions written
after the second mount will be fine, since the feature flag will be
set in the journal superblock. xfstests generic/{034,321,322} are the
regression tests.
(This is important for 3.18.)
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.coM>
Reported-by: Eric Whitney <enwlinux@gmail.com>
---
fs/jbd2/journal.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index e4dc747..1df94fa 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1853,13 +1853,12 @@ int jbd2_journal_set_features (journal_t *journal, unsigned long compat,
journal->j_chksum_driver = NULL;
return 0;
}
- }
- /* Precompute checksum seed for all metadata */
- if (jbd2_journal_has_csum_v2or3(journal))
+ /* Precompute checksum seed for all metadata */
journal->j_csum_seed = jbd2_chksum(journal, ~0,
sb->s_uuid,
sizeof(sb->s_uuid));
+ }
}
/* If enabling v1 checksums, downgrade superblock */
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] jbd2: fix regression where we fail to initialize checksum seed when loading
2014-12-02 0:22 [PATCH] jbd2: fix regression where we fail to initialize checksum seed when loading Darrick J. Wong
@ 2014-12-02 3:05 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2014-12-02 3:05 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-ext4, Eric Whitney
On Mon, Dec 01, 2014 at 04:22:23PM -0800, Darrick J. Wong wrote:
> When we're enabling journal features, we cannot use the predicate
> jbd2_journal_has_csum_v2or3() because we haven't yet set the sb
> feature flag fields! Moreover, we just finished loading the shash
> driver, so the test is unnecessary; calculate the seed always.
>
> Without this patch, we fail to initialize the checksum seed the first
> time we turn on journal_checksum, which means that all journal blocks
> written during that first mount are corrupt. Transactions written
> after the second mount will be fine, since the feature flag will be
> set in the journal superblock. xfstests generic/{034,321,322} are the
> regression tests.
>
> (This is important for 3.18.)
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.coM>
> Reported-by: Eric Whitney <enwlinux@gmail.com>
Applied, thanks. I've confirmed this has fixed the xfstests
regressions, and I'll be sending this to Linus shortly.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-02 3:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-02 0:22 [PATCH] jbd2: fix regression where we fail to initialize checksum seed when loading Darrick J. Wong
2014-12-02 3:05 ` Theodore Ts'o
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).