commit 690b374532fb165f9e6918cec0883806e5612956
tree 44fb323ae9a060e18b9f0c59fc9682af336f8089
parent 012f63081ad9cb2e5d5de4005e5cfed29f5c0edf
author Martin Doucha <mdoucha@suse.cz> 2026-01-13 16:01:55 +0100
committer Petr Vorel <pvorel@suse.cz> 2026-01-14 14:28:30 +0100

    aio_cancel_5-1: Rewrite test
    
    The test schedules multiple async writes into a file and then hopes that
    at least one will block long enough that aio_cancel() will fail to cancel
    it. Use a socket pair instead of a file to force async writes to block
    indefinitely. 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.
    
    Link: https://lore.kernel.org/ltp/20260113150202.68070-1-mdoucha@suse.cz/
    Acked-by: Andrea Cervesato <andrea.cervesato@suse.com>
    Reviewed-by: Petr Vorel <pvorel@suse.cz>
    Signed-off-by: Martin Doucha <mdoucha@suse.cz>


:100644 100644 5ed4f6d42bcf7e51a5a763e42d0defc852445498 559625b13367e325e6a88c764d6390bcf67d1313 M	testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c
