All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: linuxtestproject.agent@gmail.com
Cc: ltp@lists.linux.it
Subject: Re: [LTP] tst_kvercmp: Factor out error handling
Date: Mon, 10 Aug 2026 14:02:08 +0200	[thread overview]
Message-ID: <20260810120208.GE918586@pevik> (raw)
In-Reply-To: <20260805173540.9276-1-linuxtestproject.agent@gmail.com>

Hi all,

> Hi Petr,

> On Aug 5, 2026, Petr Vorel wrote:
> > tst_kvercmp: Factor out error handling

> --- [PATCH 1/9] ---

> > static int _tst_parse_kver(const char *str_kver, int *v1, int *v2, int *v3)

> Could this be renamed to parse_kver? File-scope identifiers beginning with an
> underscore are reserved by C, and LTP's coding rules prohibit such names.

I thought this is wrong, because we have functions with underscore, but it's
trailing underscore, not the leading one.

=> I'll rename to tst_parse_kver_().

Also, agent does not know about LTP rule to have functions in lib with leading
tst_.

> --- [PATCH 2/9] ---

> > This is a preparation for struct tst_test max_kver member in the next
> > commit.

> Could the motivation be stated without referring to the next patch? Each
> commit message should stand on its own rather than depend on series position.

Well, we try to split code into commits to be easily revieweable. With that
sometimes is hard to avoid referring to commits. Preparation for other changes
separated into it's own commit helps is an explanation itself.

=> Consider as irrelevant.

> --- [PATCH 4/9] ---

> > 	if (TST_RET != -1) {
> > 		tst_res(TFAIL, "creat() succeeded unexpectedly");
> > 		return;
> > 	}

> Could this path kill and reap pid before returning? Removing the version gate
> makes it reachable on affected 6.11 and 6.12 kernels, but the child remains
> paused indefinitely. The framework then blocks in tst_reap_children() until
> the watchdog terminates the test instead of returning the intended TFAIL.

=> Indeed, this is bug for creat07.c, at least on SLE16 kernel which is based on 6.12,
where test hangs until timeouts on:

creat07.c:43: TFAIL: creat() succeeded unexpectedly

I guess I'll simply use goto to do the needed cleanup:

+++ testcases/kernel/syscalls/creat/creat07.c
@@ -41,7 +41,7 @@ static void verify_creat(void)

        if (TST_RET != -1) {
                tst_res(TFAIL, "creat() succeeded unexpectedly");
-               return;
+               goto kill;
        }

        if (TST_ERR == ETXTBSY)
@@ -49,6 +49,7 @@ static void verify_creat(void)
        else
                tst_res(TFAIL | TTERRNO, "creat() failed unexpectedly");

+kill:
        SAFE_KILL(pid, SIGKILL);
        SAFE_WAITPID(pid, NULL, 0);
 }
---

execve04.c simply fails on that kernel which is IMHO correct (not hiding bugs):
execve_child.c:27: TFAIL: execve_child shouldn't be executed

> > 	TEST(execve(TEST_APP, argv, environ));

> How is the writer child released when execve() succeeds on an affected
> kernel? The test process is replaced by execve_child, which reports TFAIL and
> exits, while the writer remains blocked in TST_CHECKPOINT_WAKE_AND_WAIT(0) and
> becomes an orphan.

I hope the above patch fixes that. Shouldn't be this fixed separately
(regardless on a removed .min_kver), it can be problematic on any kernel
version.

> --- [PATCH 5/9] ---

> > 	.max_kver = "7.1",

> Could the test keep running and only adjust the expected result of
> FAN_REPORT_PIDFD | FAN_REPORT_TID on kernels supporting thread pidfds? This
> test-wide limit also removes the
> FAN_REPORT_PIDFD | FAN_REPORT_FID | FAN_REPORT_DFID_NAME case on 7.2 and all
> newer kernels, and that exact combination is not tested elsewhere in LTP.

No, we agreed, this is ok (I'm explaining this second time and I suppose I will
have to do it on all patchset versions I'll send).

> --- [PATCH 6/9] ---

> > 	.min_kver = "4.4",
> > 	.max_kver = "5.0",

> How can this exercise do_test() on current CI kernels? The current kernel must
> lie between the bounds; min_kver being less than max_kver is not sufficient.
> With this maximum, including on stable 7.2, the self-test only reports TCONF
> and never tests the new success path.

I deliberately wanted to get TCONF on the current kernel, i.e. the fact than
using both will result in TCONF not in TBROK. Also, it does not matter if the
test TCONF due old version or run and then TPASS, it's about testing library
setup() run with .min_kver and .max_kver (test itself does nothing). Also any
kernel version will sooner later be old and thus TCONF, why not to do it now?
Not it's also a test that any old version will just TCONF not TBROK. I try to
document it better in the test.

> --- [PATCH 7/9] ---

> > int tst_kver_cmp(int a1, int a2, int a3, int b1, int b2, int b3);

> Could the new public function's kernel-doc include a Return: section
> describing the comparison result?

Commit will be removed in the next version.

> > This will be heavily used in metaparse.c (speedup of metadata
> > generation) in the next commit.

> Could this motivation be stated without referring to the next patch? Each
> commit message should stand on its own.

> --- [PATCH 8/9] ---

> > Will be used for metadata.c in the next commit.

> Could the commit message instead explain why host targets need access to
> MAKE_DEPS without depending on a later patch?

Commit will be removed in the next version.

> --- [PATCH 9/9] ---

> > metaparse: HOST_LDLIBS		+= -lltp

> How can this work for a cross-compilation? metaparse is built with HOSTCC, but
> -lltp resolves to lib/libltp.a built with the target CC, so the host linker
> cannot consume the archive. Could the version helper be compiled with HOSTCC,
> or moved into an architecture-independent host library?

Commit will be removed in the next version.

> Verdict - Needs revision

> ---
> Note:

> The agent can sometimes produce false positives although often its
> findings are genuine. If you find issues with the review, please
> comment this email or ignore the suggestions.

> Regards,
> LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-08-10 12:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05 15:14 [LTP] [PATCH v4 0/6] Add support for .max_kver Petr Vorel
2026-08-05 15:14 ` [LTP] [PATCH v4 1/9] tst_kvercmp: Factor out error handling Petr Vorel
2026-08-05 17:33   ` [LTP] " linuxtestproject.agent
2026-08-05 17:33   ` linuxtestproject.agent
2026-08-05 17:34   ` linuxtestproject.agent
2026-08-05 17:35   ` linuxtestproject.agent
2026-08-10 12:02     ` Petr Vorel [this message]
2026-08-06  7:02   ` [LTP] [PATCH v4 1/9] " Andrea Cervesato via ltp
2026-08-10 11:33     ` Petr Vorel
2026-08-05 15:14 ` [LTP] [PATCH v4 2/9] lib: Rename function check_kver() => check_min_kver() Petr Vorel
2026-08-05 15:14 ` [LTP] [PATCH v4 3/9] lib: Add support for max_kver to struct tst_test and tst_fs Petr Vorel
2026-08-05 15:14 ` [LTP] [PATCH v4 4/9] creat07: execve04: Remove version check, add linux-git Petr Vorel
2026-08-05 15:14 ` [LTP] [PATCH v4 5/9] fanotify20: Skip on v7.2 Petr Vorel
2026-08-05 15:14 ` [LTP] [PATCH v4 6/9] lib: Add basic test for .min_kver && .max_kver Petr Vorel
2026-08-05 15:14 ` [LTP] [PATCH v4 7/9] tst_kvercmp: Factor out 2 kernels integer comparison Petr Vorel
2026-08-05 15:14 ` [LTP] [PATCH v4 8/9] [RFC] make: Allow to add LTP library as a dependency for host Petr Vorel
2026-08-05 15:14 ` [LTP] [PATCH v4 9/9] [RFC] metaparse: Check {min, max}_kver validity Petr Vorel
2026-08-06  5:37   ` Petr Vorel
2026-08-06  7:23   ` Cyril Hrubis
2026-08-10 11:23     ` Petr Vorel
  -- strict thread matches above, loose matches on Subject: below --
2026-08-10 16:00 [LTP] [PATCH v5 1/7] tst_kvercmp: Factor out error handling Petr Vorel
2026-08-10 16:57 ` [LTP] " linuxtestproject.agent
2026-08-10 17:03   ` Petr Vorel

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=20260810120208.GE918586@pevik \
    --to=pvorel@suse.cz \
    --cc=linuxtestproject.agent@gmail.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.