public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] io_uring: fix short read links and align link timeout cancel
@ 2026-06-11  1:22 Yang Xiuwei
  2026-06-11  1:22 ` [PATCH 1/2] io_uring/rw: fix link failure on successful pipe short reads Yang Xiuwei
  2026-06-11  1:22 ` [PATCH 2/2] io_uring/timeout: cancel pending link timeouts from ltimeout_list Yang Xiuwei
  0 siblings, 2 replies; 7+ messages in thread
From: Yang Xiuwei @ 2026-06-11  1:22 UTC (permalink / raw)
  To: axboe; +Cc: io-uring, Yang Xiuwei

This series addresses two independent issues affecting linked requests
behind a link timeout, found while exercising read -> link timeout ->
nop chains on pipes.

1) Short non-regular file read completion (patch 1, bug fix)

__io_read() treats a short read on non-regular files as success and
returns without filling the iov.  __io_complete_rw_common() still
treated ret != cqe.res as failure and set REQ_F_FAIL.  The head request
could therefore post a successful CQE while internally failing the link
chain, incorrectly canceling subsequent linked requests.

2) Pending link timeout cancel (patch 2, behavior alignment)

TIMEOUT_REMOVE and IORING_OP_ASYNC_CANCEL use io_timeout_cancel(), which
only scanned timeout_list.  Pending link timeouts live on ltimeout_list
instead, so cancel/remove by user_data returned -ENOENT even though the
timeout was still armed.

IORING_OP_TIMEOUT_REMOVE with IORING_LINK_TIMEOUT_UPDATE already handles
link timeouts through a separate path.  Extend io_timeout_cancel() to
fall back to ltimeout_list and reuse __io_disarm_linked_timeout(), so
plain remove/cancel behaves consistently.

The two patches are independent and may be applied separately, though
both are needed for full link-timeout chain test coverage.

Patch summary
-------------

 1/2 io_uring/rw: fix link failure on successful pipe short reads
 2/2 io_uring/timeout: cancel pending link timeouts from ltimeout_list

Test plan
---------

Matching liburing tests are submitted separately.  With both kernel
patches applied:

  $ make -C test link-timeout.t
  $ ./test/link-timeout.t

Expected highlights:

  - test_link_timeout_natural_disarm_chain: read=1, lt=-ECANCELED, nop=0
  - test_link_timeout_remove_chain: remove=0, lt=-ECANCELED, read=1,
    nop=0

io_uring/rw: fix link failure on successful pipe short reads
io_uring/timeout: cancel pending link timeouts from ltimeout_list
--
2.25.1

Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-06-12 21:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11  1:22 [PATCH 0/2] io_uring: fix short read links and align link timeout cancel Yang Xiuwei
2026-06-11  1:22 ` [PATCH 1/2] io_uring/rw: fix link failure on successful pipe short reads Yang Xiuwei
2026-06-11 18:36   ` Jens Axboe
2026-06-12  0:59     ` Yang Xiuwei
2026-06-12  6:29       ` Yang Xiuwei
2026-06-12 21:41         ` Jens Axboe
2026-06-11  1:22 ` [PATCH 2/2] io_uring/timeout: cancel pending link timeouts from ltimeout_list Yang Xiuwei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox