On Thu, Apr 05, 2018 at 09:52:25PM +0530, Souptick Joarder wrote: > Many places in drivers/ file systems error was handled > like below - > ret = (ret == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS; > > This new inline function vmf_error() will replace this > and return vm_fault_t type err. > > Signed-off-by: Souptick Joarder <jrdr.linux@xxxxxxxxx> Reviewed-by: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx> To elaborate a little more on the changelog above, a lot of drivers and filesystems currently have a rather complex mapping of errno-to-VM_FAULT code. We've been able to eliminate a lot of it by just returning VM_FAULT codes directly from functions which are called exclusively from the fault handling path. Some functions can be called both from the fault handler and other context which are expecting an errno, so they have to continue to return an errno. Some users still need to choose different behaviour for different errnos, but vmf_error() captures the essential error translation that's common to all users, and those that need to handle additional errors can handle them first. We'd like to get this into -rc1 so we can start trickling driver chanages that depend on it into the maintainer trees.