dax: fallback from pmd to pte on error
authorDan Williams <dan.j.williams@intel.com>
Wed, 24 Feb 2016 22:02:06 +0000 (14:02 -0800)
committerVishal Verma <vishal.l.verma@intel.com>
Tue, 17 May 2016 06:44:13 +0000 (00:44 -0600)
In preparation for consulting a badblocks list in pmem_direct_access(),
teach dax_pmd_fault() to fallback rather than fail immediately upon
encountering an error.  The thought being that reducing the span of the
dax request may avoid the error region.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
fs/dax.c

index 9bc6624251b4d878ff02d27634f77b2b1be5c52a..d602410d8e52c6fea96735c88e9eb1463f273279 100644 (file)
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -855,8 +855,8 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address,
                long length = dax_map_atomic(bdev, &dax);
 
                if (length < 0) {
-                       result = VM_FAULT_SIGBUS;
-                       goto out;
+                       dax_pmd_dbg(&bh, address, "dax-error fallback");
+                       goto fallback;
                }
                if (length < PMD_SIZE) {
                        dax_pmd_dbg(&bh, address, "dax-length too small");