On Wed, Jan 4, 2017 at 8:45 AM, Stefan Hajnoczi <stefanha(a)redhat.com> wrote:
In drivers/nvdimm/pmem.c:pmem_do_bvec() reads are handled as
rc = -EIO;
rc = read_pmem(page, off, pmem_addr, len);
read_pmem() returns -EFAULT on error so the error return value of
pmem_do_bvec() is either -EIO or -EFAULT. EFAULT strikes me as unusual for a
function used in the block I/O code path.
Is the distinction between EIO and EFAULT significant for pmem_do_bvec() callers?
It looks like all users except btrfs just check if bi_error is non-zero
If not, should the function return -EIO in both cases?
I'm leaning toward fixing up btrfs to handle all errors as I/O errors.
Otherwise, it's not clear to me why
fs/btrfs/volumes.c::btrfs_end_bio() would need to parse error codes,
but drivers/md/raid5.c::raid5_end_read_request() does not.
Should probably address it both ways, make btrfs more tolerant in what
it accepts and make pmem more consistent / conservative in what it