Skip to content

Commit 5579d97

Browse files
Mikulas Patockagregkh
authored andcommitted
dm integrity: limit the rate of error messages
commit 2255574 upstream. When using dm-integrity underneath md-raid, some tests with raid auto-correction trigger large amounts of integrity failures - and all these failures print an error message. These messages can bring the system to a halt if the system is using serial console. Fix this by limiting the rate of error messages - it improves the speed of raid recovery and avoids the hang. Fixes: 7eada90 ("dm: add integrity target") Cc: stable@vger.kernel.org # v4.12+ Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7668d6e commit 5579d97

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/md/dm-integrity.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,8 +1357,8 @@ static void integrity_metadata(struct work_struct *w)
13571357
checksums_ptr - checksums, !dio->write ? TAG_CMP : TAG_WRITE);
13581358
if (unlikely(r)) {
13591359
if (r > 0) {
1360-
DMERR("Checksum failed at sector 0x%llx",
1361-
(unsigned long long)(sector - ((r + ic->tag_size - 1) / ic->tag_size)));
1360+
DMERR_LIMIT("Checksum failed at sector 0x%llx",
1361+
(unsigned long long)(sector - ((r + ic->tag_size - 1) / ic->tag_size)));
13621362
r = -EILSEQ;
13631363
atomic64_inc(&ic->number_of_mismatches);
13641364
}
@@ -1550,8 +1550,8 @@ static bool __journal_read_write(struct dm_integrity_io *dio, struct bio *bio,
15501550

15511551
integrity_sector_checksum(ic, logical_sector, mem + bv.bv_offset, checksums_onstack);
15521552
if (unlikely(memcmp(checksums_onstack, journal_entry_tag(ic, je), ic->tag_size))) {
1553-
DMERR("Checksum failed when reading from journal, at sector 0x%llx",
1554-
(unsigned long long)logical_sector);
1553+
DMERR_LIMIT("Checksum failed when reading from journal, at sector 0x%llx",
1554+
(unsigned long long)logical_sector);
15551555
}
15561556
}
15571557
#endif

0 commit comments

Comments
 (0)