summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/kvec/errors.rs
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2026-10-11 01:35:49 -0500
committerJens Axboe <axboe@kernel.dk>2026-10-15 18:25:35 -0600
commit4915dc0a1834457520ef0592bfd454b26901614f (patch)
tree0198968e0d650d02d5f5de8e906a06310cadc86e /rust/kernel/alloc/kvec/errors.rs
parent84824afdb5a4dc127fbd7036142d7611c5e53651 (diff)
ublk: allow a NULL io->cmd in the cancel callback
A cancel from the control path, like STOP_DEV's ublk_cancel_dev() after dropping ub->mutex, takes the command and clears io->cmd under cancel_lock, then completes it with io_uring_cmd_done(), which takes uring_lock to remove it from the cancelable list. The server's io_uring cancel runs ublk_uring_cmd_cancel_fn() under uring_lock in between: control path cancel io_uring cancel (uring_lock) io->cmd = NULL, CANCELED io_uring_cmd_done() waits for uring_lock cmd still on the list ublk_uring_cmd_cancel_fn(cmd) io->cmd == NULL: WARN ublk_cancel_cmd() then sees CANCELED and leaves the command alone, so nothing is wrong; only warn if io->cmd holds another command. Fixes: ab03a61c6614 ("ublk: have a per-io daemon instead of a per-queue daemon") Tested-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Ming Lei <tom.leiming@gmail.com> Link: https://patch.msgid.link/20261011063555.1142277-7-tom.leiming@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions