From: Matthew Wilcox <>

dax_load_hole was swallowing the errors from vm_insert_mixed().
Use vmf_insert_mixed() instead to get a vm_fault_t, and convert
dax_load_hole() to the vm_fault_t convention.

Signed-off-by: Matthew Wilcox <>
 fs/dax.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/dax.c b/fs/dax.c
index bcc3fd05ab03..44785346c02f 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -808,18 +808,19 @@ static int dax_iomap_pfn(struct iomap *iomap, loff_t pos, 
size_t size,
  * If this page is ever written to we will re-fault and change the mapping to
  * point to real DAX storage instead.
-static int dax_load_hole(struct xa_state *xas, struct address_space *mapping,
-               void **entry, struct vm_fault *vmf)
+static vm_fault_t dax_load_hole(struct xa_state *xas,
+               struct address_space *mapping, void **entry,
+               struct vm_fault *vmf)
        struct inode *inode = mapping->host;
        unsigned long vaddr = vmf->address;
-       int ret = VM_FAULT_NOPAGE;
+       vm_fault_t ret;
        pfn_t pfn = pfn_to_pfn_t(my_zero_pfn(vaddr));
        *entry = dax_insert_entry(xas, mapping, *entry, pfn, DAX_ZERO_PAGE,
-       vm_insert_mixed(vmf->vma, vaddr, pfn);
+       ret = vmf_insert_mixed(vmf->vma, vaddr, pfn);
        trace_dax_load_hole(inode, vmf, ret);
        return ret;

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Linux-f2fs-devel mailing list

Reply via email to