]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.31/dm-integrity-limit-the-rate-of-error-messages.patch
Linux 4.14.108
[thirdparty/kernel/stable-queue.git] / releases / 4.19.31 / dm-integrity-limit-the-rate-of-error-messages.patch
1 From 225557446856448039a9e495da37b72c20071ef2 Mon Sep 17 00:00:00 2001
2 From: Mikulas Patocka <mpatocka@redhat.com>
3 Date: Wed, 6 Mar 2019 08:29:34 -0500
4 Subject: dm integrity: limit the rate of error messages
5
6 From: Mikulas Patocka <mpatocka@redhat.com>
7
8 commit 225557446856448039a9e495da37b72c20071ef2 upstream.
9
10 When using dm-integrity underneath md-raid, some tests with raid
11 auto-correction trigger large amounts of integrity failures - and all
12 these failures print an error message. These messages can bring the
13 system to a halt if the system is using serial console.
14
15 Fix this by limiting the rate of error messages - it improves the speed
16 of raid recovery and avoids the hang.
17
18 Fixes: 7eada909bfd7a ("dm: add integrity target")
19 Cc: stable@vger.kernel.org # v4.12+
20 Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
21 Signed-off-by: Mike Snitzer <snitzer@redhat.com>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24 ---
25 drivers/md/dm-integrity.c | 8 ++++----
26 1 file changed, 4 insertions(+), 4 deletions(-)
27
28 --- a/drivers/md/dm-integrity.c
29 +++ b/drivers/md/dm-integrity.c
30 @@ -1357,8 +1357,8 @@ again:
31 checksums_ptr - checksums, !dio->write ? TAG_CMP : TAG_WRITE);
32 if (unlikely(r)) {
33 if (r > 0) {
34 - DMERR("Checksum failed at sector 0x%llx",
35 - (unsigned long long)(sector - ((r + ic->tag_size - 1) / ic->tag_size)));
36 + DMERR_LIMIT("Checksum failed at sector 0x%llx",
37 + (unsigned long long)(sector - ((r + ic->tag_size - 1) / ic->tag_size)));
38 r = -EILSEQ;
39 atomic64_inc(&ic->number_of_mismatches);
40 }
41 @@ -1550,8 +1550,8 @@ retry_kmap:
42
43 integrity_sector_checksum(ic, logical_sector, mem + bv.bv_offset, checksums_onstack);
44 if (unlikely(memcmp(checksums_onstack, journal_entry_tag(ic, je), ic->tag_size))) {
45 - DMERR("Checksum failed when reading from journal, at sector 0x%llx",
46 - (unsigned long long)logical_sector);
47 + DMERR_LIMIT("Checksum failed when reading from journal, at sector 0x%llx",
48 + (unsigned long long)logical_sector);
49 }
50 }
51 #endif