nvdimm read EFAULT vs EIO
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 20170104164530.GA10372-lxVrvc10SDRcolVlb+j0YCZi+YwRKgec@public.gmane.org
Quoted 9 lines · Stefan Hajnoczi
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); }
Quoted 5 lines
read_pmem()returns-EFAULTon error so the error return value ofpmem_do_bvec()is either-EIOor-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
Quoted 1 line
If not, should the function return
-EIOin 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.