[LTP] [PATCH v2] openposix: Fix aio_suspend/1-1 completion race

Petr Vorel pvorel@suse.cz
Thu Oct 1 18:16:04 CEST 2026


Hi Andrea,

> The aio_suspend/1-1 test relies on regular-file I/O remaining pending
> until the test checks its status. If the selected request completes
> too quickly, the test reports an unresolved result.

> Replace regular-file I/O with writes to a socket pair, using the
> existing AIO setup and cleanup helpers. A second thread waits for the
> main thread to sleep before draining the socket. This preserves the
> pending-request check and exercises aio_suspend() waiting for I/O.

> The test passed 100 normal runs and 100 runs pinned to one CPU.
> It also rejected all 30 injected cases where aio_suspend() returned
> success without waiting. Build, checkpatch, and whitespace checks
> passed.

> Changes in v2:
> - Preserve the pending-I/O check, following Martin Doucha's feedback.
> - Use a full socket and a coordinated draining thread.
> - Reuse setup_aio() and cleanup_aio().
> - Link to v1:
>   https://lore.kernel.org/20261001-fix_aio_suspend-1-1-v1-1-ac365dc874ef@suse.com
> ---
>  .../conformance/interfaces/aio_suspend/1-1.c       | 284 +++++++++------------
>  1 file changed, 118 insertions(+), 166 deletions(-)

> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c
> index 8f0c9ae95..d08709ee9 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c
> @@ -7,216 +7,168 @@
>   */

>  /*
> - * assertion:
I'm not sure how important is to keep the doc structure, but other tests
keep having "assertion:" and "method:" (e.g.
testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c
which Martin rewrote).
That somehow correlates with assertions for aio_suspend() in
testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/assertions.xml

nit: I'd also update copyright (worth for major rewrite).

The code itself LGTM. I wonder if Martin finds something.
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr


More information about the ltp mailing list