[PATCH 0/2] test/link-timeout: add regression tests for link timeout chains
Yang Xiuwei <[email protected]>
| Newsgroups | org.kernel.vger.io-uring |
|---|---|
| Message-ID | <[email protected]> |
This series adds liburing regression tests for read -> link timeout -> nop
chains on pipes. The tests complement two independent io_uring kernel
changes submitted separately:
- io_uring/rw: fix link failure on successful pipe short reads
- io_uring/timeout: cancel pending link timeouts from ltimeout_list
Without the kernel fixes, short pipe reads can incorrectly fail the link
chain and cancel subsequent requests, and TIMEOUT_REMOVE against a pending
link timeout returns -ENOENT because only timeout_list was scanned.
Patch summary
-------------
1/2 test/link-timeout: add natural disarm chain with short pipe read
2/2 test/link-timeout: add link timeout remove tests
Test cases
----------
- test_link_timeout_natural_disarm_chain (patch 1)
read(LINK) -> link timeout(LINK) -> nop, with a 1-byte pipe write.
Expect read=1, link timeout=-ECANCELED, nop=0 after natural disarm.
Requires the kernel short read completion fix.
- test_link_timeout_remove (patch 2)
read(LINK) -> link timeout, then TIMEOUT_REMOVE by user_data.
Expect remove=0 and link timeout=-ECANCELED.
Requires the kernel link timeout cancel fix.
- test_link_timeout_remove_chain (patch 2)
read(LINK) -> link timeout(LINK) -> nop, then TIMEOUT_REMOVE, then
complete the read with a 1-byte write.
Expect remove=0, link timeout=-ECANCELED, read=1, nop=0.
Requires both kernel fixes.
Test plan
---------
With both kernel patches applied:
$ make -C test link-timeout.t
$ ./test/link-timeout.t
Without the kernel patches, the new tests are expected to fail on current
upstream kernels.
test/link-timeout: add natural disarm chain with short pipe read
test/link-timeout: add link timeout remove tests
--
2.25.1
Signed-off-by: Yang Xiuwei <[email protected]>