]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: ublk: add stop command with --safe option
authorMing Lei <ming.lei@redhat.com>
Mon, 12 Jan 2026 22:05:02 +0000 (00:05 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 12 Jan 2026 22:07:31 +0000 (15:07 -0700)
commit65955a0993a0a9536263fea2eaae8aed496dcc9c
treeae4c0ab8b5945356ccc4a93aef212ce83195511a
parent93ada1b3da398b492c45429cef1a1c9651d5c7ba
selftests: ublk: add stop command with --safe option

Add 'stop' subcommand to kublk utility that uses the new
UBLK_CMD_TRY_STOP_DEV command when --safe option is specified.
This allows stopping a device only if it has no active openers,
returning -EBUSY otherwise.

Also add test_generic_16.sh to test the new functionality.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/Makefile
tools/testing/selftests/ublk/kublk.c
tools/testing/selftests/ublk/kublk.h
tools/testing/selftests/ublk/test_generic_16.sh [new file with mode: 0755]