All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v4] aio_cancel_7-1: Rewrite test
Date: Tue, 16 Sep 2025 12:18:21 +0200	[thread overview]
Message-ID: <20250916101821.GA251329@pevik> (raw)
In-Reply-To: <20250915144836.6201-1-mdoucha@suse.cz>

Hi Martin,

> The test schedules multiple async writes into a file and then hopes that
> at least one will block long enough that it can be canceled
> before completion. Use a socket pair instead of a file to force async
> writes to block indefinitely and make sure at least one can be canceled.
> Then wait for one of the writes to actually block on full socket buffer.
> This fixes a race condition where aio_cancel() could be called while
> no write is actually in progress (before the first write, after the last
> one or between two writes) and the test would fail.

> Also rewrite result checks to verify that all writes before the blocked
> one actually completed and all writes after the blocked one were cancelled.

> Add cleanup helper function that will flush socket buffers, free allocated
> memory and close the sockets. Also make setup and cleanup simpler
> by statically allocating the aiocb structure array.

Great idea, nice rewrite, thank you!

Reviewed-by: Petr Vorel <pvorel@suse.cz>

...
>  #include <stdio.h>
>  #include <sys/types.h>
>  #include <unistd.h>
>  #include <sys/stat.h>

nit: also <sys/stat.h> and <sys/types.h> can be removed before merging.

Kind regards,
Petr

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

  reply	other threads:[~2025-09-16 10:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 14:48 [LTP] [PATCH v4] aio_cancel_7-1: Rewrite test Martin Doucha
2025-09-16 10:18 ` Petr Vorel [this message]
2025-09-17  9:26 ` Li Wang via ltp
2025-09-18 15:21 ` Cyril Hrubis
2025-09-18 15:26   ` Martin Doucha
2025-09-18 22:46     ` Li Wang 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=20250916101821.GA251329@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.