On Wed, Jan 4, 2017 at 8:45 AM, Stefan Hajnoczi <[email protected]> wrote:
> In drivers/nvdimm/pmem.c:pmem_do_bvec() reads are handled as follows:
>
>   if (unlikely(bad_pmem))
>           rc = -EIO;
>   else {
>           rc = read_pmem(page, off, pmem_addr, len);
>           flush_dcache_page(page);
>   }
>
> 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
sends.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to