public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v1] ioctl_pidfd06: Accept both ESRCH and EREMOTE for PIDFD_GET_INFO
Date: Mon,  6 Apr 2026 02:35:34 +0000	[thread overview]
Message-ID: <20260406023538.14739-1-wegao@suse.com> (raw)

LTP commit f630471a6520 attempted to handle this using a kernel version
check (7.0.0). However, this is proving unreliable as the change is
appearing in earlier kernel versions (e.g., 6.19.x) due to different
release cycles or backports.

Fixes: f630471a6520 ("ioctl_pidfd06: Select expected errno for PIDFD_GET_INFO across pidns")
Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c b/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c
index 0f24d4741..fec85d680 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c
@@ -14,7 +14,10 @@
 
 static struct tst_clone_args *args;
 static struct pidfd_info *info;
-static int err_nr = ESRCH;
+static int exp_errnos[] = {
+	ESRCH,
+	EREMOTE,
+};
 
 static void run(void)
 {
@@ -42,7 +45,10 @@ static void run(void)
 	args->exit_signal = SIGCHLD;
 
 	if (!SAFE_CLONE(args)) {
-		TST_EXP_FAIL(ioctl(pidfd, PIDFD_GET_INFO, info), err_nr);
+		TST_EXP_FAIL_ARR(
+				ioctl(pidfd, PIDFD_GET_INFO, info),
+				exp_errnos, ARRAY_SIZE(exp_errnos)
+				);
 		exit(0);
 	}
 
@@ -53,9 +59,6 @@ static void setup(void)
 {
 	if (!ioctl_pidfd_info_exit_supported())
 		tst_brk(TCONF, "PIDFD_INFO_EXIT is not supported by ioctl()");
-
-	if (tst_kvercmp(7, 0, 0) >= 0)
-		err_nr = EREMOTE;
 }
 
 static struct tst_test test = {
-- 
2.52.0


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

                 reply	other threads:[~2026-04-06  2:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260406023538.14739-1-wegao@suse.com \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox