]> git.baikalelectronics.ru Git - kernel.git/commit
jbd2: fix regression where we fail to initialize checksum seed when loading
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 2 Dec 2014 00:22:23 +0000 (16:22 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 2 Dec 2014 02:57:06 +0000 (21:57 -0500)
commit123122e3615da5a018312c3e6bdadf27040cf5db
treeae0c664340718615b9c8470605a8f7c3fbe884fa
parent560bafeb23e4501651a67282c16c3859b44cf3df
jbd2: fix regression where we fail to initialize checksum seed when loading

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>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/journal.c