From: Cyril Hrubis <chrubis@suse.cz>
To: Matthew Wilcox <willy@infradead.org>
Cc: Reuben Hawkins <reubenhwk@gmail.com>,
amir73il@gmail.com, mszeredi@redhat.com, brauner@kernel.org,
lkp@intel.com, linux-fsdevel@vger.kernel.org,
oliver.sang@intel.com, viro@zeniv.linux.org.uk,
oe-lkp@lists.linux.dev, ltp@lists.linux.it,
Jan Kara <jack@suse.cz>
Subject: Re: [PATCH v3] vfs: fix readahead(2) on block devices
Date: Mon, 25 Sep 2023 10:32:50 +0200 [thread overview]
Message-ID: <ZRFFsrgJ9tZQt1Hs@yuki> (raw)
In-Reply-To: <ZQ/hGr+o61X1mik9@casper.infradead.org>
Hi!
> I realise we could add new test cases _basically_ forever, but I'd like
> to see a little more coverage in test_invalid_fd(). It currently tests
> both pipes and sockets, but we have so many more fd types. Maybe there
> are good abstractions inside LTP already for creating these? I'd
> like to see tests that the following also return -EINVAL:
>
> - an io_uring fd
> - /dev/zero
> - /proc/self/maps (or something else in /proc we can get unprivileged
> access to)
> - a directory (debatable! maybe we should allow prefetching a
> directory!)
This sounds like a good idea. We do have an API to iterate over
filesystems but not API to iterate over file descriptors, I suppose that
we will need an enum with fd type passed along with the file descriptor
so that we can set the expectations right and then just define a
function that would take the structure and do the test, something as:
enum tst_fd_type {
TST_FD_IO_URING,
TST_FD_DEV_ZERO,
TST_FD_PROC_MAPS,
...
};
struct tst_fd {
enum tst_fd_type type;
int fd;
};
static void test_fd(struct tst_fd *fd)
{
if (fd->type == TST_FD...)
TST_EXP_PASS(...);
else
TST_EXP_FAIL(...);
}
I can add something like this once we are done with the September LTP
release.
--
Cyril Hrubis
chrubis@suse.cz
prev parent reply other threads:[~2023-09-25 8:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-24 5:08 [PATCH v3] vfs: fix readahead(2) on block devices Reuben Hawkins
2023-09-24 7:11 ` Matthew Wilcox
2023-09-24 10:30 ` Christian Brauner
2023-09-24 14:35 ` Matthew Wilcox
2023-09-25 12:47 ` Christian Brauner
2023-09-25 8:32 ` Cyril Hrubis [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=ZRFFsrgJ9tZQt1Hs@yuki \
--to=chrubis@suse.cz \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=ltp@lists.linux.it \
--cc=mszeredi@redhat.com \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.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).