linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libnvdimm: fix clear length of nvdimm_forget_poison()
@ 2017-04-27 22:57 Toshi Kani
  2017-04-27 22:57 ` [PATCH 2/2] libnvdimm: clear region badblock in nvdimm_clear_poison() Toshi Kani
  2017-04-28 21:48 ` [PATCH 1/2] libnvdimm: fix clear length of nvdimm_forget_poison() Dan Williams
  0 siblings, 2 replies; 10+ messages in thread
From: Toshi Kani @ 2017-04-27 22:57 UTC (permalink / raw)
  To: dan.j.williams
  Cc: dave.jiang, vishal.l.verma, linux-nvdimm, linux-kernel, Toshi Kani

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.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
---
Based on 'libnvdimm-for-next'.
---
 drivers/nvdimm/bus.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
index d214ac44..43ddfd4 100644
--- a/drivers/nvdimm/bus.c
+++ b/drivers/nvdimm/bus.c
@@ -219,7 +219,9 @@ long nvdimm_clear_poison(struct device *dev, phys_addr_t phys,
 	if (cmd_rc < 0)
 		return cmd_rc;
 
-	nvdimm_forget_poison(nvdimm_bus, phys, len);
+	if (clear_err.cleared > 0)
+		nvdimm_forget_poison(nvdimm_bus, phys, clear_err.cleared);
+
 	return clear_err.cleared;
 }
 EXPORT_SYMBOL_GPL(nvdimm_clear_poison);

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-05-01 15:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27 22:57 [PATCH 1/2] libnvdimm: fix clear length of nvdimm_forget_poison() Toshi Kani
2017-04-27 22:57 ` [PATCH 2/2] libnvdimm: clear region badblock in nvdimm_clear_poison() Toshi Kani
2017-04-29  0:10   ` Dan Williams
2017-04-29  0:12     ` Dan Williams
2017-04-29  0:35       ` Dan Williams
2017-05-01 15:05         ` Kani, Toshimitsu
2017-04-28 21:48 ` [PATCH 1/2] libnvdimm: fix clear length of nvdimm_forget_poison() Dan Williams
2017-04-28 22:29   ` Kani, Toshimitsu
2017-04-28 22:39     ` Dan Williams
2017-04-28 22:41       ` Kani, Toshimitsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).