]> git.karo-electronics.de Git - linux-beck.git/commit
pmem: return EIO on read_pmem() failure
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 5 Jan 2017 10:05:46 +0000 (10:05 +0000)
committerDan Williams <dan.j.williams@intel.com>
Fri, 13 Jan 2017 00:40:29 +0000 (16:40 -0800)
commitd47d1d27fd6206c18806440f6ebddf51a806be4f
tree5aa1994533c4f587b61a9123cf78e52cfe2bbea6
parenta121103c922847ba5010819a3f250f1f7fc84ab8
pmem: return EIO on read_pmem() failure

The read_pmem() function uses memcpy_mcsafe() on x86 where an EFAULT
error code indicates a failed read.  Block I/O should use EIO to
indicate failure.  Other pmem code paths (like bad blocks) already use
EIO so let's be consistent.

This fixes compatibility with consumers like btrfs that try to parse the
specific error code rather than treat all errors the same.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/pmem.c