From: Darrick J. Wong Date: Tue, 14 Oct 2014 06:35:49 +0000 (-0400) Subject: ext4: check s_chksum_driver when looking for bg csum presence X-Git-Tag: fixes-against-v3.18-rc2~28^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=813d32f91333e4c33d5a19b67167c4bae42dae75;p=pandora-kernel.git ext4: check s_chksum_driver when looking for bg csum presence Convert the ext4_has_group_desc_csum predicate to look for a checksum driver instead of the metadata_csum flag and change the bg checksum calculation function to look for GDT_CSUM before taking the crc16 path. Without this patch, if we mount with ^uninit_bg,^metadata_csum and later metadata_csum gets turned on by accident, the block group checksum functions will incorrectly assume that checksumming is enabled (metadata_csum) but that crc16 should be used (!s_chksum_driver). This is totally wrong, so fix the predicate and the checksum formula selection. (Granted, if the metadata_csum feature bit gets enabled on a live FS then something underhanded is going on, but we could at least avoid writing garbage into the on-disk fields.) Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o Reviewed-by: Dmitry Monakhov Cc: stable@vger.kernel.org --- Reading git-diff-tree failed