public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3] io_submit04: Add test case for RWF_NOWAIT flag
Date: Tue, 6 Jan 2026 09:39:47 +0100	[thread overview]
Message-ID: <20260106083947.GA687576@pevik> (raw)
In-Reply-To: <aVyrMIHYwxncN6J_@autotest-wegao.qe.prg2.suse.org>

Hi all,

...
> > > +static void run(void)
> > > +{
> > > +	struct io_event evbuf;
> > > +	struct timespec timeout = { .tv_sec = 1 };
> > > +	long nr = 1;
> > > +
> > > +	TEST(tst_syscall(__NR_io_submit, ctx, nr, iocbs));
> > > +
> > > +	if (TST_RET == nr)
> > > +		tst_res(TPASS, "io_submit() pass");
> > > +	else
> > > +		tst_res(TFAIL | TTERRNO, "io_submit() returns %ld, expected %ld", TST_RET, nr);

> > Our goal is to verify that io_getevents() returns EAGAIN, so we can just:

> > if (TST_RET != nr) {
> > 	tst_res(TBROK | TTERRNO, "io_submit() returns %ld, expected %ld", TST_RET, nr);
> > 	return;
> > }

> > We return because if io_submit() fails there's nothing to do more.
> tst_res(TBROK will trigger error such as :
> make[1]: Leaving directory '/home/wegao/ltp/lib'
> In file included from ../../../../include/tst_test.h:20,
>                  from io_submit04.c:14:
> io_submit04.c: In function ‘run’:
> ../../../../include/tst_common.h:80:32: error: size of unnamed array is negative
>    80 |         do { ((void)sizeof(char[1 - 2 * !!(condition)])); } while (0)
>       |                                ^
> ../../../../include/tst_common.h:83:9: note: in expansion of macro ‘TST_BUILD_BUG_ON’
>    83 |         TST_BUILD_BUG_ON(condition)
>       |         ^~~~~~~~~~~~~~~~
> ../../../../include/tst_test.h:71:17: note: in expansion of macro ‘TST_RES_SUPPORTS_TCONF_TDEBUG_TFAIL_TINFO_TPASS_TWARN’
>    71 |                 TST_RES_SUPPORTS_TCONF_TDEBUG_TFAIL_TINFO_TPASS_TWARN(\
>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> io_submit04.c:63:17: note: in expansion of macro ‘tst_res’
>    63 |                 tst_res(TBROK | TTERRNO, "io_submit() returns %ld, expected %ld",
>       |                 ^~~~~~~
> make: *** [../../../../include/mk/rules.mk:48: io_submit04] Error 1
> -bash: ./io_submit04: No such file or directory

> So i suppose we need use "tst_brk(TBROK" without return, correct?

Yes, that's a macro which enforces using TBROK only with tst_brk().

@Cyril @Li @Jan I wonder if we still need this enforcement after Cyril's change
a1f82704c2 ("lib/tst_test.c: Fix tst_brk() handling")

Kind regards,
Petr

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

  parent reply	other threads:[~2026-01-06  8:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29  1:27 [LTP] [PATCH v1] io_submit04: Add test case for RWF_NOWAIT flag Wei Gao via ltp
2024-02-06 15:59 ` Petr Vorel
2025-10-22  2:05 ` [LTP] [PATCH v2] " Wei Gao via ltp
2025-12-18 13:21   ` Andrea Cervesato via ltp
2025-12-24  8:49   ` [LTP] [PATCH v3] " Wei Gao via ltp
2026-01-05 12:53     ` Andrea Cervesato via ltp
2026-01-06  6:26       ` Wei Gao via ltp
2026-01-06  8:39         ` Andrea Cervesato via ltp
2026-01-06  8:39         ` Petr Vorel [this message]
2026-01-07  8:53           ` Jan Stancek via ltp
2026-01-07  6:10     ` [LTP] [PATCH v4] " Wei Gao via ltp
2026-02-18 12:21       ` Andrea Cervesato via ltp
2026-03-05  4:41         ` Wei Gao via ltp
2026-03-17  7:43       ` [LTP] [PATCH v5] " Wei Gao via ltp
2026-03-17  9:54         ` Andrea Cervesato via ltp
2026-03-17 11:46         ` [LTP] [PATCH v6] " Wei Gao via ltp
2026-03-20 12:54           ` Andrea Cervesato via ltp
2026-03-27 18:17           ` Petr Vorel
2026-03-30  8:08             ` Wei Gao via ltp
2026-04-04  1:00             ` Wei Gao via ltp
2026-03-31 11:18           ` [LTP] [PATCH v7] fanotify22.c: handle multiple asynchronous error events Wei Gao via ltp
2026-04-04  1:13           ` [LTP] [PATCH v7] io_submit04: Add test case for RWF_NOWAIT flag Wei Gao 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=20260106083947.GA687576@pevik \
    --to=pvorel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox