From: Wei Gao via ltp <ltp@lists.linux.it>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v4] unshare03.c: Add test coverage for dup_fd() failure handling in unshare_fd()
Date: Wed, 5 Mar 2025 02:04:29 -0500 [thread overview]
Message-ID: <Z8f3fbHD56aJrsMk@wegao> (raw)
In-Reply-To: <361f2b39-3deb-462d-90fe-4f2ee2de9b60@suse.com>
On Tue, Mar 04, 2025 at 09:31:03AM +0100, Andrea Cervesato wrote:
> Hi,
>
> thanks for editing the last version. A couple of comments below.
>
> On 3/4/25 05:06, Wei Gao via ltp wrote:
> > + nr_open + 1024);
> > +
> > + SAFE_DUP2(2, nr_open + 64);
> > +
> > + if (!SAFE_CLONE(&args)) {
> > + SAFE_FILE_PRINTF(FS_NR_OPEN, "%d", nr_open);
> > + TST_EXP_FAIL(unshare(CLONE_FILES), EMFILE);
> > + TST_CHECKPOINT_WAKE(0);
> There's no need to use synchronization mechanisms because at the end of the
> test we call tst_reap_children() waiting for all the children to be
> completed.
There are some race condition happen and trigger failure sometimes if you do not
use this synchronization(Currently no idea why this happen).
Rerun case 30 times can trigger 2 or 3 cases failed if not use synchronization in my env.
> > + exit(0);
> > + }
> > +
> > + TST_CHECKPOINT_WAIT(0);
> > +}
> > +
> > +static void setup(void)
> > +{
> > + clone3_supported_by_kernel();
> > +}
> > +
> > +static struct tst_test test = {
> > + .forks_child = 1,
> > + .needs_root = 1,
> > + .test_all = run,
> > + .setup = setup,
> > + .needs_checkpoints = 1,
> > + .save_restore = (const struct tst_path_val[]) {
> > + {FS_NR_OPEN, NULL, TST_SR_TCONF},
> > + {}
> > + },
> > +};
> > +
> > +#else
> > +TST_TEST_TCONF("unshare syscall is undefined.");
> > +#endif
>
> The rest looks good. If you want I can edit the checkpoint thing and merge
> this patch.
>
> Kind regards,
> Andrea Cervesato
>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-03-05 7:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 8:19 [LTP] [PATCH v1] unshare03.c: Add test coverage for dup_fd() failure handling in unshare_fd() Wei Gao via ltp
2025-02-19 15:12 ` Andrea Cervesato via ltp
2025-03-03 9:42 ` [LTP] [PATCH v2] " Wei Gao via ltp
2025-03-03 10:47 ` Andrea Cervesato via ltp
2025-03-04 4:03 ` Wei Gao via ltp
2025-03-04 3:43 ` [LTP] [PATCH v3] " Wei Gao via ltp
2025-03-04 4:06 ` [LTP] [PATCH v4] " Wei Gao via ltp
2025-03-04 8:31 ` Andrea Cervesato via ltp
2025-03-05 7:04 ` Wei Gao via ltp [this message]
2025-03-05 12:11 ` Andrea Cervesato via ltp
2025-03-06 2:24 ` Wei Gao via ltp
2025-03-06 2:22 ` [LTP] [PATCH v5] " Wei Gao via ltp
2025-03-06 8:23 ` Andrea Cervesato via ltp
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=Z8f3fbHD56aJrsMk@wegao \
--to=ltp@lists.linux.it \
--cc=andrea.cervesato@suse.com \
--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