]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/ublk: fix error handling for starting device
authorMing Lei <ming.lei@redhat.com>
Tue, 13 Jan 2026 08:58:01 +0000 (16:58 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 21 Jan 2026 14:54:55 +0000 (07:54 -0700)
commit23e62cf75518825aac12e9a22bdc40f062428898
treef6e47cea299c65875a7300e0518a3708e951051e
parent75aad5ffe099a1b1a342257236dc260493917ed2
selftests/ublk: fix error handling for starting device

Fix error handling in ublk_start_daemon() when start_dev fails:

1. Call ublk_ctrl_stop_dev() to cancel inflight uring_cmd before
   cleanup. Without this, the device deletion may hang waiting for
   I/O completion that will never happen.

2. Add fail_start label so that pthread_join() is called on the
   error path. This ensures proper thread cleanup when startup fails.

Fixes: 6aecda00b7d1 ("selftests: ublk: add kernel selftests for ublk")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/kublk.c