]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 May 2017 10:39:53 +0000 (12:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 May 2017 10:39:53 +0000 (12:39 +0200)
added patches:
libnvdimm-fix-clear-length-of-nvdimm_forget_poison.patch

queue-4.9/libnvdimm-fix-clear-length-of-nvdimm_forget_poison.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/libnvdimm-fix-clear-length-of-nvdimm_forget_poison.patch b/queue-4.9/libnvdimm-fix-clear-length-of-nvdimm_forget_poison.patch
new file mode 100644 (file)
index 0000000..731f83d
--- /dev/null
@@ -0,0 +1,41 @@
+From 8d13c0290655b883df9083a2a0af0d782bc38aef Mon Sep 17 00:00:00 2001
+From: Toshi Kani <toshi.kani@hpe.com>
+Date: Thu, 27 Apr 2017 16:57:05 -0600
+Subject: libnvdimm: fix clear length of nvdimm_forget_poison()
+
+From: Toshi Kani <toshi.kani@hpe.com>
+
+commit 8d13c0290655b883df9083a2a0af0d782bc38aef upstream.
+
+ND_CMD_CLEAR_ERROR command returns 'clear_err.cleared', the length
+of error actually cleared, which may be smaller than its requested
+'len'.
+
+Change nvdimm_clear_poison() to call nvdimm_forget_poison() with
+'clear_err.cleared' when this value is valid.
+
+Fixes: e046114af5fc ("libnvdimm: clear the internal poison_list when clearing badblocks")
+Cc: Dave Jiang <dave.jiang@intel.com>
+Cc: Vishal Verma <vishal.l.verma@intel.com>
+Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/nvdimm/bus.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/nvdimm/bus.c
++++ b/drivers/nvdimm/bus.c
+@@ -218,7 +218,10 @@ long nvdimm_clear_poison(struct device *
+       if (cmd_rc < 0)
+               return cmd_rc;
+-      nvdimm_clear_from_poison_list(nvdimm_bus, phys, len);
++      if (clear_err.cleared > 0)
++              nvdimm_clear_from_poison_list(nvdimm_bus, phys,
++                                            clear_err.cleared);
++
+       return clear_err.cleared;
+ }
+ EXPORT_SYMBOL_GPL(nvdimm_clear_poison);
index bdf4bdcf412904468ef094717159a5a004a3b117..f845cea3a42a74d1b19adf63f191e2e7aef9af50 100644 (file)
@@ -74,3 +74,4 @@ usb-serial-ftdi_sio-add-olimex-arm-usb-tiny-h-pids.patch
 usb-chaoskey-fix-alea-quirk-on-big-endian-hosts.patch
 f2fs-check-entire-encrypted-bigname-when-finding-a-dentry.patch
 fscrypt-avoid-collisions-when-presenting-long-encrypted-filenames.patch
+libnvdimm-fix-clear-length-of-nvdimm_forget_poison.patch