public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET] Cancel requests at ring close time
@ 2026-09-09 14:06 Jens Axboe
  2026-09-09 14:06 ` [PATCH 1/7] io_uring/uring_cmd: only cancel requests of the given task Jens Axboe
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Jens Axboe @ 2026-09-09 14:06 UTC (permalink / raw)
  To: io-uring; +Cc: juanlu

Hi,

As it stands, io_uring cancels requests in an async fashion when the
ring fd is closed. This can cause some application confusion, if the
application expects files to be fully closed by the time close(2) of the
ring fd returns. We've had reports before where someone doing IO to
/mnt/file, closes the ring and then attempts a umount, and gets -EBUSY
on the umount. Or more recently from the TigerBeetle folks, where their
shutdown is a backend kill, and that still ends up with file locks being
active until the background cancelations have been run.

This series attempts to make that more predictable, by canceling
everything sync, upfront, when the ring fd is closed.

Series can also be found here:

https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git/log/?h=io_uring-exit-cancel.4

 include/linux/io_uring_types.h |   2 +
 io_uring/cancel.c              |  89 +++++++++++++---
 io_uring/cancel.h              |  13 ++-
 io_uring/io_uring.c            | 180 ++++++++++++++++++++++++++-------
 io_uring/notif.c               |   2 +
 io_uring/timeout.c             |  18 ++++
 io_uring/timeout.h             |   2 +
 io_uring/uring_cmd.c           |   4 +-
 io_uring/uring_cmd.h           |   2 +-
 9 files changed, 260 insertions(+), 52 deletions(-)

-- 
Jens Axboe


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

end of thread, other threads:[~2026-09-09 14:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-09 14:06 [PATCHSET] Cancel requests at ring close time Jens Axboe
2026-09-09 14:06 ` [PATCH 1/7] io_uring/uring_cmd: only cancel requests of the given task Jens Axboe
2026-09-09 14:06 ` [PATCH 2/7] io_uring/notif: count pending zerocopy notifications per ring Jens Axboe
2026-09-09 14:06 ` [PATCH 3/7] io_uring/cancel: cancel and wait for all requests on process exit Jens Axboe
2026-09-09 14:06 ` [PATCH 4/7] io_uring: run cancelations synchronously on ring release Jens Axboe
2026-09-09 14:06 ` [PATCH 5/7] io_uring: drop registered files and buffers at release time Jens Axboe
2026-09-09 14:06 ` [PATCH 6/7] io_uring: wait for in-flight requests on ring release Jens Axboe
2026-09-09 14:06 ` [PATCH 7/7] io_uring/io-wq: put the request file before posting a completion Jens Axboe

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