Commit 97681f9b authored by Toshi Kani's avatar Toshi Kani Committed by Dan Williams

libnvdimm: fix phys_addr for nvdimm_clear_poison

nvdimm_clear_poison() expects a physical address, not an offset.
Fix nsio_rw_bytes() to call nvdimm_clear_poison() with a physical
address.
Signed-off-by: default avatarToshi Kani <toshi.kani@hpe.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Reviewed-by: default avatarVishal Verma <vishal.l.verma@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent bc042fdf
...@@ -246,7 +246,8 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns, ...@@ -246,7 +246,8 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)) { if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)) {
long cleared; long cleared;
cleared = nvdimm_clear_poison(&ndns->dev, offset, size); cleared = nvdimm_clear_poison(&ndns->dev,
nsio->res.start + offset, size);
if (cleared < size) if (cleared < size)
rc = -EIO; rc = -EIO;
if (cleared > 0 && cleared / 512) { if (cleared > 0 && cleared / 512) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment