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:54 -0500
committerJens Axboe <axboe@kernel.dk>2026-10-15 18:25:35 -0600
commitbcab0b98566b8f73f8e398d4f12a088b81885459 (patch)
treef63cdeb2902650166ec5277d9d13a1e2cc466d81 /rust/kernel/alloc/kvec/errors.rs
parent9703575564aa7c74d6746e4ed2d3f8a99af7590c (diff)
selftests: ublk: add test for going live over canceled io commands
Add ublk_cancel_ready, a small liburing program which sends control commands with kublk's helpers from ctrl.c, and test_generic_18.sh, which runs its modes: mode what it does expected stop_start STOP_DEV before START_DEV START_DEV -EBUSY partial_fetch task A fetches tags 0-2 and START_DEV -EBUSY dies, then task B fetches tag 3 recovery in user recovery, queue 0's END_USER_RECOVERY task dies before queue 1 is -EBUSY ready stop_restart STOP_DEV on a new device, then START_DEV 0, a server starts it reads succeed stop_attached STOP_DEV after open, before FETCH ABORT and FETCH, then a new server START_DEV -EBUSY, then a new one works stop_live_restart STOP_DEV on a live device, then FETCH and START_DEV a new server starts it 0, reads succeed race_start STOP_DEV and START_DEV at the START_DEV 0 and same time, 50 times reads complete, or -EBUSY race_fetch STOP_DEV while a server opens START_DEV 0 and and fetches, then START_DEV, reads succeed, 50 times or -EBUSY race_async_fetch IOSQE_ASYNC FETCH while STOP_DEV no crash (KASAN cancels, then close the ring finds the bug) race_batch_stop STOP_DEV while kublk's batch kublk add returns, server prepares and fetches, started or not 20 times If the device goes live, the test reads it, so an unfixed kernel shows the oops in ublk_queue_cmd(). In stop_live_restart, an unfixed kernel doesn't reset the FETCH round in ublk_ch_release() once the disk is gone, so the new server's FETCH gets -EBUSY. A dying task is a child process which fetches and then calls exec(). exec() cancels the task's uring_cmds before it returns, so the cancel is done once the child is reaped, with no sleep. kublk can't be used: its failure injection kills the whole process, which closes /dev/ublkcN and starts a new round. Link: https://lore.kernel.org/linux-block/20260928-b4-ublk-cancel-stop-v1-0-4a4360232a46@toxicpanda.com/ Signed-off-by: Ming Lei <tom.leiming@gmail.com> Assisted-by: LLM Link: https://patch.msgid.link/20261011063555.1142277-12-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