From: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
To: Jan Stancek <jstancek@redhat.com>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] finit_module02: fix exp. errno for O_WRONLY testcase
Date: Wed, 17 Nov 2021 07:54:39 +0000 [thread overview]
Message-ID: <6194B56D.9070100@fujitsu.com> (raw)
In-Reply-To: <04692b4000ee415add41128173e395f830ea3e56.1635168255.git.jstancek@redhat.com>
Hi Jan
> commit 032146cda855 ("vfs: check fd has read access in
> kernel_read_file_from_fd()") changed errno back to EBADF,
> which is correct value according to man page, so tweak
> the test to expect it for kernels>= 5.15.
It seems we still can hit ETXTBSY error if we use RDWR fd on kernels >=
5.15.
This error existed since the following commit because of
deny_write_access api
commit 39d637af5aa7577f655c58b9e55587566c63a0af
Author: Dmitry Kasatkin <dmitry.kasatkin@huawei.com>
Date: Sun Oct 26 12:42:07 2014 +0200
vfs: forbid write access when reading a file into memory
I suggest add a RDWR test and send a patch to record a ETXTBSY error(
Since linux 4.7).
What do you think about this?
Best Regards
Yang Xu
>
> Signed-off-by: Jan Stancek<jstancek@redhat.com>
> ---
> testcases/kernel/syscalls/finit_module/finit_module02.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/finit_module/finit_module02.c b/testcases/kernel/syscalls/finit_module/finit_module02.c
> index 0d2bf917ea64..9b5d3563b74e 100644
> --- a/testcases/kernel/syscalls/finit_module/finit_module02.c
> +++ b/testcases/kernel/syscalls/finit_module/finit_module02.c
> @@ -52,7 +52,7 @@ static void bad_fd_setup(struct tcase *tc)
>
> static void wo_file_setup(struct tcase *tc)
> {
> - if (tst_kvercmp(4, 6, 0)< 0)
> + if (tst_kvercmp(4, 6, 0)< 0 || tst_kvercmp(5, 15, 0)>= 0)
> tc->exp_errno = EBADF;
> else
> tc->exp_errno = ETXTBSY;
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2021-11-17 7:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 13:25 [LTP] [PATCH] finit_module02: fix exp. errno for O_WRONLY testcase Jan Stancek
2021-10-26 8:04 ` Cyril Hrubis
2021-10-26 10:35 ` Jan Stancek
2021-10-26 10:42 ` [LTP] [PATCH v2] " Jan Stancek
2021-10-26 10:52 ` Cyril Hrubis
2021-10-26 11:57 ` Jan Stancek
2021-10-26 15:08 ` Cyril Hrubis
2021-10-26 15:15 ` Jan Stancek
2021-11-17 7:54 ` xuyang2018.jy [this message]
2021-11-22 6:42 ` [LTP] [PATCH] " Jan Stancek
2021-11-22 7:09 ` xuyang2018.jy
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=6194B56D.9070100@fujitsu.com \
--to=xuyang2018.jy@fujitsu.com \
--cc=jstancek@redhat.com \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.