Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dm-verity-fec: warn even when there were no errors

Currently FEC logs a warning message if at least one error was
corrected, or an error message if there were uncorrectable errors.
However, it doesn't log anything if there were no errors.

"No errors" is actually unexpected, though, considering that dm-verity
calls verity_fec_decode() only when a block's digest doesn't match.

If there were to ever be a bug where verity_fec_decode() is called on
blocks with the correct digest, then there would be no indication in the
log that FEC is running and degrading performance.

Therefore, let's log the warning message even when there were no errors.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

authored by

Eric Biggers and committed by
Mikulas Patocka
0e4c1eb5 23e6e57a

+1 -1
+1 -1
drivers/md/dm-verity-fec.c
··· 133 133 if (r < 0 && neras) 134 134 DMERR_LIMIT("%s: FEC %llu: failed to correct: %d", 135 135 v->data_dev->name, target_block, r); 136 - else if (r == 0 && corrected > 0) 136 + else if (r == 0) 137 137 DMWARN_LIMIT("%s: FEC %llu: corrected %d errors", 138 138 v->data_dev->name, target_block, corrected); 139 139