From: Cyril Hrubis <chrubis@suse.cz>
To: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
Cc: Richard Palethorpe <rpalethorpe@suse.com>,
"ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] containers/utsname04: don't use TST_EXP_EQ_LI for tst_clone
Date: Tue, 28 Feb 2023 10:39:52 +0100 [thread overview]
Message-ID: <Y/3L6GjSfRHT7+ir@yuki> (raw)
In-Reply-To: <f80d0b90-f7c7-d979-9a97-22655f7ff1b2@fujitsu.com>
Hi!
> > Did you try this?
> >
> > TST_EXP_FAIL(tst_clone(&cargs), EPERM);
>
> I don't try this because I remembered TST_EXP_FAIL only thinks the
> correct return value is -1.
>
> tst_test.c:1560: TINFO: Timeout per run is 0h 00m 30s
> utsname04.c:27: TINFO: Dropping root privileges
> utsname04.c:33: TFAIL: tst_clone(&cargs) invalid retval -2: EPERM (1)
It's actually the tst_clone() that returns -2 if fallback to __NR_clone
failed.
@Ritchie Is there actually a good reason why tst_clone() returns -2 on a
fialure? Can we fix the code by:
diff --git a/lib/tst_clone.c b/lib/tst_clone.c
index ecc84408c..bacd269d9 100644
--- a/lib/tst_clone.c
+++ b/lib/tst_clone.c
@@ -39,8 +39,5 @@ pid_t tst_clone(const struct tst_clone_args *tst_args)
pid = syscall(__NR_clone, flags, NULL);
#endif
- if (pid == -1)
- return -2;
-
return pid;
}
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-02-28 9:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-28 8:44 [LTP] [PATCH] containers/utsname04: don't use TST_EXP_EQ_LI for tst_clone Yang Xu
2023-02-28 9:06 ` Andrea Cervesato via ltp
2023-02-28 9:18 ` xuyang2018.jy
2023-02-28 9:39 ` Cyril Hrubis [this message]
2023-03-03 6:11 ` xuyang2018.jy
2023-03-06 14:10 ` Richard Palethorpe
2023-03-07 6:09 ` [LTP] [PATCH v2] " Yang Xu
2023-03-07 8:35 ` Richard Palethorpe
2023-03-07 10:16 ` Richard Palethorpe
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=Y/3L6GjSfRHT7+ir@yuki \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=rpalethorpe@suse.com \
--cc=xuyang2018.jy@fujitsu.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