pmem: return EIO on read_pmem() failure
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 5 Jan 2017 10:05:46 +0000 (10:05 +0000)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 03:06:00 +0000 (03:06 +0000)
commit1fa465dd39960fb9d9941db9bf7256d3190333f3
tree22d8138c8edeb1d7b06313acedf9b246de26dd1b
parent7a9018b4c4b87f53242fc47326cccd75036848c7
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