From: Ross Zwisler <ross.zwisler@linux.intel.com>
To: Matthew Wilcox <willy@linux.intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Dan Williams <dan.j.williams@intel.com>,
linux-nvdimm@ml01.01.org
Subject: Re: [PATCH] dax: check return value of dax_radix_entry()
Date: Wed, 2 Mar 2016 09:33:46 -0700 [thread overview]
Message-ID: <20160302163346.GA22821@linux.intel.com> (raw)
In-Reply-To: <20160302140947.GL3730@linux.intel.com>
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.
prev parent reply other threads:[~2016-03-02 16:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 22:15 [PATCH] dax: check return value of dax_radix_entry() Ross Zwisler
2016-03-02 14:09 ` Matthew Wilcox
2016-03-02 16:33 ` Ross Zwisler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160302163346.GA22821@linux.intel.com \
--to=ross.zwisler@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@ml01.01.org \
--cc=willy@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).