lkml.org 
[lkml]   [2016]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dax: check return value of dax_radix_entry()
On Wed, Mar 02, 2016 at 09:09:47AM -0500, Matthew Wilcox wrote:
> On Tue, Mar 01, 2016 at 03:15:08PM -0700, Ross Zwisler wrote:
> > dax_pfn_mkwrite() previously wasn't checking the return value of the call
> > to dax_radix_entry(), which was a mistake.
> >
> > Instead, capture this return value and pass it up the stack if it is an
> > error.
>
> > */
> > - dax_radix_entry(file->f_mapping, vmf->pgoff, NO_SECTOR, false, true);
> > + error = dax_radix_entry(file->f_mapping, vmf->pgoff, NO_SECTOR, false,
> > + true);
> > + if (error)
> > + return error;
> > +
> > return VM_FAULT_NOPAGE;
>
> You can't return an errno from here.
>
> if (error)
> return VM_FAULT_SIGBUS;
>
> is better. For full points,
>
> if (error == -ENOMEM)
> return VM_FAULT_OOM;
> if (error)
> return VM_FAULT_SIGBUS;
> return VM_FAULT_NOPAGE;

Ah, thank you for catching that.

\
 
 \ /
  Last update: 2016-03-02 18:21    [W:0.056 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site