[PATCH v2] dax: enable dax fault handler to report VM_FAULT_HWPOISON

2023-04-06 Thread Jane Chu
When dax fault handler fails to provision the fault page due to hwpoison, it returns VM_FAULT_SIGBUS which lead to a sigbus delivered to userspace with .si_code BUS_ADRERR. Channel dax backend driver's detection on hwpoison to the filesystem to provide the precise reason for the fault.

Re: [PATCH] dax: enable dax fault handler to report VM_FAULT_HWPOISON

2023-04-06 Thread Jane Chu
On 4/6/2023 12:32 PM, Matthew Wilcox wrote: On Thu, Apr 06, 2023 at 11:55:56AM -0600, Jane Chu wrote: static vm_fault_t dax_fault_return(int error) { if (error == 0) return VM_FAULT_NOPAGE; - return vmf_error(error); + else if (error == -ENOMEM) +

Re: [PATCH] dax: enable dax fault handler to report VM_FAULT_HWPOISON

2023-04-06 Thread Matthew Wilcox
On Thu, Apr 06, 2023 at 11:55:56AM -0600, Jane Chu wrote: > static vm_fault_t dax_fault_return(int error) > { > if (error == 0) > return VM_FAULT_NOPAGE; > - return vmf_error(error); > + else if (error == -ENOMEM) > + return VM_FAULT_OOM; > + else if

[PATCH] dax: enable dax fault handler to report VM_FAULT_HWPOISON

2023-04-06 Thread Jane Chu
When dax fault handler fails to provision the fault page due to hwpoison, it returns VM_FAULT_SIGBUS which lead to a sigbus delivered to userspace with .si_code BUS_ADRERR. Channel dax backend driver's detection on hwpoison to the filesystem to provide the precise reason for the fault.