]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Mar 2019 08:19:00 +0000 (09:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Mar 2019 08:19:00 +0000 (09:19 +0100)
added patches:
dm-fix-to_sector-for-32bit.patch
dm-integrity-limit-the-rate-of-error-messages.patch

queue-4.14/dm-fix-to_sector-for-32bit.patch [new file with mode: 0644]
queue-4.14/dm-integrity-limit-the-rate-of-error-messages.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/dm-fix-to_sector-for-32bit.patch b/queue-4.14/dm-fix-to_sector-for-32bit.patch
new file mode 100644 (file)
index 0000000..ce73604
--- /dev/null
@@ -0,0 +1,43 @@
+From 0bdb50c531f7377a9da80d3ce2d61f389c84cb30 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neil@brown.name>
+Date: Sun, 6 Jan 2019 21:06:25 +1100
+Subject: dm: fix to_sector() for 32bit
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: NeilBrown <neil@brown.name>
+
+commit 0bdb50c531f7377a9da80d3ce2d61f389c84cb30 upstream.
+
+A dm-raid array with devices larger than 4GB won't assemble on
+a 32 bit host since _check_data_dev_sectors() was added in 4.16.
+This is because to_sector() treats its argument as an "unsigned long"
+which is 32bits (4GB) on a 32bit host.  Using "unsigned long long"
+is more correct.
+
+Kernels as early as 4.2 can have other problems due to to_sector()
+being used on the size of a device.
+
+Fixes: 0cf4503174c1 ("dm raid: add support for the MD RAID0 personality")
+cc: stable@vger.kernel.org (v4.2+)
+Reported-and-tested-by: Guillaume PerrĂ©al <gperreal@free.fr>
+Signed-off-by: NeilBrown <neil@brown.name>
+Signed-off-by: Mike Snitzer <snitzer@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/device-mapper.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/include/linux/device-mapper.h
++++ b/include/linux/device-mapper.h
+@@ -630,7 +630,7 @@ do {                                                                       \
+  */
+ #define dm_target_offset(ti, sector) ((sector) - (ti)->begin)
+-static inline sector_t to_sector(unsigned long n)
++static inline sector_t to_sector(unsigned long long n)
+ {
+       return (n >> SECTOR_SHIFT);
+ }
diff --git a/queue-4.14/dm-integrity-limit-the-rate-of-error-messages.patch b/queue-4.14/dm-integrity-limit-the-rate-of-error-messages.patch
new file mode 100644 (file)
index 0000000..94158fe
--- /dev/null
@@ -0,0 +1,51 @@
+From 225557446856448039a9e495da37b72c20071ef2 Mon Sep 17 00:00:00 2001
+From: Mikulas Patocka <mpatocka@redhat.com>
+Date: Wed, 6 Mar 2019 08:29:34 -0500
+Subject: dm integrity: limit the rate of error messages
+
+From: Mikulas Patocka <mpatocka@redhat.com>
+
+commit 225557446856448039a9e495da37b72c20071ef2 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: 7eada909bfd7a ("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>
+
+---
+ drivers/md/dm-integrity.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/md/dm-integrity.c
++++ b/drivers/md/dm-integrity.c
+@@ -1276,8 +1276,8 @@ again:
+                                               checksums_ptr - checksums, !dio->write ? TAG_CMP : TAG_WRITE);
+                       if (unlikely(r)) {
+                               if (r > 0) {
+-                                      DMERR("Checksum failed at sector 0x%llx",
+-                                            (unsigned long long)(sector - ((r + ic->tag_size - 1) / ic->tag_size)));
++                                      DMERR_LIMIT("Checksum failed at sector 0x%llx",
++                                                  (unsigned long long)(sector - ((r + ic->tag_size - 1) / ic->tag_size)));
+                                       r = -EILSEQ;
+                                       atomic64_inc(&ic->number_of_mismatches);
+                               }
+@@ -1469,8 +1469,8 @@ retry_kmap:
+                                       integrity_sector_checksum(ic, logical_sector, mem + bv.bv_offset, checksums_onstack);
+                                       if (unlikely(memcmp(checksums_onstack, journal_entry_tag(ic, je), ic->tag_size))) {
+-                                              DMERR("Checksum failed when reading from journal, at sector 0x%llx",
+-                                                    (unsigned long long)logical_sector);
++                                              DMERR_LIMIT("Checksum failed when reading from journal, at sector 0x%llx",
++                                                          (unsigned long long)logical_sector);
+                                       }
+                               }
+ #endif
index a0eff0a81eb9da8b4aca6bb2d4afce2afb05c69d..2ccf597739d9a8cc871ce8bfdd89f74a4d1b536f 100644 (file)
@@ -148,3 +148,5 @@ arm-s3c24xx-fix-boolean-expressions-in-osiris_dvs_notify.patch
 arm64-fix-hcr.tge-status-for-nmi-contexts.patch
 arm64-debug-ensure-debug-handlers-check-triggering-exception-level.patch
 arm64-kvm-fix-architecturally-invalid-reset-value-for-fpexc32_el2.patch
+dm-fix-to_sector-for-32bit.patch
+dm-integrity-limit-the-rate-of-error-messages.patch