From: Christian Brauner <brauner@kernel.org>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Reuben Hawkins <reubenhwk@gmail.com>,
linux-fsdevel@vger.kernel.org, mszeredi@redhat.com,
willy@infradead.org, viro@zeniv.linux.org.uk
Subject: Re: [PATCH] vfs: fix readahead(2) on block devices
Date: Sun, 10 Sep 2023 12:02:19 +0200 [thread overview]
Message-ID: <20230910-werken-sololauf-df32fb5dcddc@brauner> (raw)
In-Reply-To: <CAOQ4uxiEmJjWQV=cbrmwXF0N1vyRi8sej9ZqbieUUct4_uWuEw@mail.gmail.com>
On Sat, Sep 09, 2023 at 09:36:10AM +0300, Amir Goldstein wrote:
> On Sat, Sep 9, 2023 at 7:39 AM Reuben Hawkins <reubenhwk@gmail.com> wrote:
> >
> > Readahead was factored to call generic_fadvise. That refactor broke
> > readahead on block devices.
>
> More accurately: That refactor added a S_ISREG restriction to the syscall
> that broke readahead on block devices.
>
> >
> > The fix is to check F_ISFIFO rather than F_ISREG. It would also work to
> > not check and let generic_fadvise to do the checking, but then the
> > generic_fadvise return value would have to be checked and changed from
> > -ESPIPE to -EINVAL to comply with the readahead(2) man-pages.
> >
>
> We do not treat the man-pages as a holy script :)
>
> It is quite likely that the code needs to change and the man-page will
> also be changed to reflect the fact that ESPIPE is a possible return value.
> In fact, see what the man page says about posix_fadvise(2):
>
> ESPIPE The specified file descriptor refers to a pipe or FIFO.
> (ESPIPE is the error specified by POSIX, but before kernel version
> 2.6.16, Linux returned EINVAL in this case.)
>
> My opinion is that we should drop the ISREG/ISFIFO altogether,
> let the error code change to ESPIPE, and send a patch to man-pages
> to reflect that change (after it was merged and released),
> but I would like to hear what other people think.
Probably fine with the understanding that if we get regression reports
it needs to be reverted quickly and the two of you are around to take
care of that... ;)
next prev parent reply other threads:[~2023-09-10 10:05 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-09 4:38 [PATCH] vfs: fix readahead(2) on block devices Reuben Hawkins
2023-09-09 6:36 ` Amir Goldstein
2023-09-10 10:02 ` Christian Brauner [this message]
2023-09-11 8:15 ` Amir Goldstein
2023-09-19 2:47 ` kernel test robot
2023-09-19 8:43 ` Amir Goldstein
[not found] ` <CAD_8n+TpZF2GoE1HUeBLs0vmpSna0yR9b+hsd-VC1ZurTe41LQ@mail.gmail.com>
2023-09-21 14:44 ` Amir Goldstein
2023-09-22 9:10 ` [LTP] " Cyril Hrubis
[not found] ` <CAD_8n+ShV=HJuk5v-JeYU1f+MAq1nDz9GqVmbfK9NpNThRjzSg@mail.gmail.com>
2023-09-23 5:56 ` Amir Goldstein
2023-09-23 14:41 ` Matthew Wilcox
2023-09-23 15:48 ` Amir Goldstein
[not found] ` <CAD_8n+SNKww4VwLRsBdOg+aBc7pNzZhmW9TPcj9472_MjGhWyg@mail.gmail.com>
2023-09-24 6:46 ` Amir Goldstein
2023-09-24 11:47 ` Amir Goldstein
2023-09-24 14:27 ` Matthew Wilcox
2023-09-24 15:32 ` Amir Goldstein
2023-09-24 21:56 ` Matthew Wilcox
[not found] ` <CAD_8n+SBo4EaU4-u+DaEFq3Bgii+vX0JobsqJV-4m+JjY9wq8w@mail.gmail.com>
2023-09-25 6:42 ` Matthew Wilcox
2023-09-25 9:43 ` Amir Goldstein
2023-09-25 12:39 ` Christian Brauner
[not found] ` <CAD_8n+QeGwf+CGNW_WnyRNQMu9G2_HJ4RSwJGq-b4CERpaA4uQ@mail.gmail.com>
2023-09-25 16:51 ` Amir Goldstein
2023-09-26 10:08 ` Christian Brauner
2023-09-26 1:56 ` Oliver Sang
2023-09-26 5:34 ` Amir Goldstein
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=20230910-werken-sololauf-df32fb5dcddc@brauner \
--to=brauner@kernel.org \
--cc=amir73il@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=reubenhwk@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.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).