From: Greg Kroah-Hartman Date: Tue, 23 May 2017 10:39:53 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v3.18.55~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2acb18e447f0022751561206fbfd6af8b4b5207f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: libnvdimm-fix-clear-length-of-nvdimm_forget_poison.patch --- 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 index 00000000000..731f83db7a1 --- /dev/null +++ b/queue-4.9/libnvdimm-fix-clear-length-of-nvdimm_forget_poison.patch @@ -0,0 +1,41 @@ +From 8d13c0290655b883df9083a2a0af0d782bc38aef Mon Sep 17 00:00:00 2001 +From: Toshi Kani +Date: Thu, 27 Apr 2017 16:57:05 -0600 +Subject: libnvdimm: fix clear length of nvdimm_forget_poison() + +From: Toshi Kani + +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 +Cc: Vishal Verma +Signed-off-by: Toshi Kani +Signed-off-by: Dan Williams +Signed-off-by: Greg Kroah-Hartman + +--- + 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); diff --git a/queue-4.9/series b/queue-4.9/series index bdf4bdcf412..f845cea3a42 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -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