pmem: return EIO on read_pmem() failure
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 5 Jan 2017 10:05:46 +0000 (10:05 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jul 2017 12:40:25 +0000 (14:40 +0200)
commit8eaaf66d41adf7b9b31486f03d93de3a1013e28d
tree65072abb76ebc4ffe8ec06411b13ece6ebee3575
parent25319ae8e8a72a3fcdac7c964d267ca3c4e7c0a0
pmem: return EIO on read_pmem() failure

[ Upstream commit d47d1d27fd6206c18806440f6ebddf51a806be4f ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvdimm/pmem.c