From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] syscalls/utimensat01: add exception for Ubuntu 4.4 kernel
Date: Mon, 17 Aug 2020 14:42:02 +0200 [thread overview]
Message-ID: <20200817124202.GB8445@yuki.lan> (raw)
In-Reply-To: <20200817120644.9401-3-po-hsu.lin@canonical.com>
Hi!
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
> ---
> testcases/kernel/syscalls/utimensat/utimensat01.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/utimensat/utimensat01.c b/testcases/kernel/syscalls/utimensat/utimensat01.c
> index 7dabfed6d..469cb61c5 100644
> --- a/testcases/kernel/syscalls/utimensat/utimensat01.c
> +++ b/testcases/kernel/syscalls/utimensat/utimensat01.c
> @@ -158,6 +158,10 @@ static void tst_multi_set_time(enum tst_ts_type type, struct mytime *mytime)
>
> static void update_error(struct test_case *tc)
> {
> + static struct tst_kern_exv kvers[] = {
> + { "UBUNTU", "4.4.0-48.69" },
> + };
> +
> if (tc->exp_err != -1)
> return;
>
> @@ -167,9 +171,12 @@ static void update_error(struct test_case *tc)
> * This patch has also been merged to stable 4.4 with
> * b3b4283 ("vfs: move permission checking into notify_change() for utimes(NULL)")
> */
> - if (tst_kvercmp(4, 4, 27) < 0)
> + if (tst_kvercmp(4, 4, 27) < 0) {
> tc->exp_err = EACCES;
> - else
> + // Special case for Ubuntu kernel, which got this patch since 4.4.0-48.69
> + if (tst_kvercmp2(4, 4, 0, kvers))
> + tc->exp_err = EPERM;
> + } else
> tc->exp_err = EPERM;
This whole thing looks broken, this is not how the tst_kvercmp2() is
supposed to work. The generic kernel version is supposed to be passed in
the first parameters and the kvers overrides that option.
So this should be something like:
if (tst_kvercmp2(4, 4, 27, kvers) < 0)
tc->exp_err = EACCESS;
else
tc->exp_err = EPERM;
And in a case that the distro matches to UBUNTU the kernel version is
compared against the "4.4.0-48.69" instead of the generic one.
> }
>
> --
> 2.17.1
>
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2020-08-17 12:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-17 12:06 [LTP] [PATCH 0/2] Fix for syscalls/utimensat01 test on Ubuntu 4.4 kernel Po-Hsu Lin
2020-08-17 12:06 ` [LTP] [PATCH 1/2] lib/tst_kvercmp: Add support to get distname for Ubuntu in tst_kvcmp_distname Po-Hsu Lin
2020-08-17 12:34 ` Cyril Hrubis
2020-08-17 12:45 ` Cyril Hrubis
2020-08-18 9:37 ` Po-Hsu Lin
2020-08-17 12:06 ` [LTP] [PATCH 2/2] syscalls/utimensat01: add exception for Ubuntu 4.4 kernel Po-Hsu Lin
2020-08-17 12:42 ` Cyril Hrubis [this message]
2020-08-18 9:40 ` Po-Hsu Lin
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=20200817124202.GB8445@yuki.lan \
--to=chrubis@suse.cz \
--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.