jbd2: gate checksum calculations on crc driver presence, not sb flags
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 15 Oct 2015 14:30:36 +0000 (10:30 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 15 Oct 2015 14:30:36 +0000 (10:30 -0400)
commit8595798ca34d186d39abcb277591e541776c0ef5
tree2a88574a18479f688e837cf4169b58d438e9d5bf
parentb90197b655185a11640cce3a0a0bc5d8291b8ad2
jbd2: gate checksum calculations on crc driver presence, not sb flags

Change the journal's checksum functions to gate on whether or not the
crc32c driver is loaded, and gate the loading on the superblock bits.
This prevents a journal crash if someone loads a journal in no-csum
mode and then randomizes the superblock, thus flipping on the feature
bits.

Tested-By: Nikolay Borisov <kernel@kyup.com>
Reported-by: Nikolay Borisov <kernel@kyup.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/journal.c
include/linux/jbd2.h