From: Cyril Hrubis <chrubis@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3] fcntl40.c: Test fcntl using F_CREATED_QUERY
Date: Wed, 2 Apr 2025 12:29:43 +0200 [thread overview]
Message-ID: <Z-0Rl4jlbplAQQR_@yuki.lan> (raw)
In-Reply-To: <20250401075642.16656-1-wegao@suse.com>
Hi!
> +static void verify_fcntl(void)
> +{
> + int fd;
> +
> + fd = SAFE_OPEN("/dev/null", O_RDONLY | O_CLOEXEC);
> +
> + /* We didn't create "/dev/null". */
> + TST_EXP_EQ_LI(fcntl(fd, F_CREATED_QUERY, 0), 0);
> + SAFE_CLOSE(fd);
> +
> + fd = SAFE_OPEN(TEST_NAME, O_CREAT | O_RDONLY | O_CLOEXEC, 0600);
> +
> + TST_EXP_EQ_LI(fcntl(fd, F_CREATED_QUERY, 0), 1);
> + SAFE_CLOSE(fd);
> +
> + fd = SAFE_OPEN(TEST_NAME, O_RDONLY | O_CLOEXEC);
> +
> + /* We're opening it again, so no positive creation check. */
> + TST_EXP_EQ_LI(fcntl(fd, F_CREATED_QUERY, 0), 0);
> + SAFE_CLOSE(fd);
> + SAFE_UNLINK(TEST_NAME);
> +
> + /* tst_res(TPASS, "fcntl F_CREATED_QUERY check pass"); */
Why is this line here? It's not even proper comment, just commented out
code. It should have been removed.
> +}
> +
> +static struct tst_test test = {
> + .test_all = verify_fcntl,
> + .needs_tmpdir = 1,
> + .min_kver = "6.12",
> + .tags = (const struct tst_tag[]) {
> + {"linux-git", "d0fe8920cbe4"},
This points to the kernel commit that added the test. Commit tags are
only for kernel commits that fixed a kernel bug, not for commits where
functionality was added.
> + {}
> + }
> +};
> --
> 2.35.3
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-04-02 10:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-28 11:44 [LTP] [PATCH v1] fcntl40.c: Test fcntl using F_CREATED_QUERY Wei Gao via ltp
2025-02-20 12:34 ` Andrea Cervesato via ltp
2025-03-01 6:31 ` [LTP] [PATCH v2] " Wei Gao via ltp
2025-03-03 8:24 ` Andrea Cervesato via ltp
2025-04-01 7:56 ` [LTP] [PATCH v3] " Wei Gao via ltp
2025-04-02 10:29 ` Cyril Hrubis [this message]
2025-04-03 6:58 ` [LTP] [PATCH v4] " Wei Gao via ltp
2025-04-07 11:31 ` Cyril Hrubis
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=Z-0Rl4jlbplAQQR_@yuki.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=wegao@suse.com \
/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.