From: "Pádraig Brady" <P@draigBrady.com>
To: Eric Wong <normalperson@yhbt.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fadvise: avoid EINVAL if user input is valid
Date: Sat, 25 Feb 2012 22:56:21 +0000 [thread overview]
Message-ID: <4F496715.7070005@draigBrady.com> (raw)
In-Reply-To: <20120225022710.GA29455@dcvr.yhbt.net>
On 02/25/2012 02:27 AM, Eric Wong wrote:
> The kernel is not required to act on fadvise, so fail silently
> and ignore advice as long as it has a valid descriptor and
> parameters.
>
> @@ -106,12 +105,8 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
> nrpages = end_index - start_index + 1;
> if (!nrpages)
> nrpages = ~0UL;
> -
> - ret = force_page_cache_readahead(mapping, file,
> - start_index,
> - nrpages);
> - if (ret > 0)
> - ret = 0;
> +
> + force_page_cache_readahead(mapping, file, start_index, nrpages);
> break;
This whole patch makes sense to me.
The above chunk might cause confusion in future,
if people wonder for a moment why the return is ignored.
Should you use cast with (void) like this to be explicit?
(void) force_page_cache_readahead(...);
cheers,
Pádraig.
next prev parent reply other threads:[~2012-02-25 22:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-25 2:27 [PATCH] fadvise: avoid EINVAL if user input is valid Eric Wong
2012-02-25 22:56 ` Pádraig Brady [this message]
2012-02-25 23:10 ` Eric Wong
2012-02-26 5:52 ` Hillf Danton
2012-02-26 8:44 ` Eric Wong
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=4F496715.7070005@draigBrady.com \
--to=p@draigbrady.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=normalperson@yhbt.net \
/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).