Skip to content

Commit

Permalink
libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_…
Browse files Browse the repository at this point in the history
…bytes()

Commit 60622d6 "x86/asm/memcpy_mcsafe: Return bytes remaining"
converted callers of memcpy_mcsafe() to expect a positive 'bytes
remaining' value rather than a negative error code. The nsio_rw_bytes()
conversion failed to return success. The failure is benign in that
nsio_rw_bytes() will end up writing back what it just read.

Fixes: 60622d6 ("x86/asm/memcpy_mcsafe: Return bytes remaining")
Cc: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Dan Williams committed Jun 29, 2018
1 parent 7daf201 commit b62cc6f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/nvdimm/claim.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
return -EIO;
if (memcpy_mcsafe(buf, nsio->addr + offset, size) != 0)
return -EIO;
return 0;
}

if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) {
Expand Down

0 comments on commit b62cc6f

Please sign in to comment.