From: Matthew Wilcox <willy@infradead.org>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH] include: mm: Adding new inline function vmf_error
Date: Thu, 5 Apr 2018 09:52:48 -0700 [thread overview]
Message-ID: <20180405165248.GG28128@bombadil.infradead.org> (raw)
In-Reply-To: <20180405162225.GA23411@jordon-HP-15-Notebook-PC>
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@gmail.com>
Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
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.
next prev parent reply other threads:[~2018-04-05 16:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-05 16:22 [PATCH] include: mm: Adding new inline function vmf_error Souptick Joarder
2018-04-05 16:52 ` Matthew Wilcox [this message]
2018-04-05 19:53 ` Andrew Morton
2018-04-05 20:26 ` Matthew Wilcox
2018-05-02 6:17 ` Souptick Joarder
2018-05-02 21:12 ` Andrew Morton
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=20180405165248.GG28128@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=jrdr.linux@gmail.com \
--cc=linux-mm@kvack.org \
/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).