selftests: ublk: fix starting ublk device
authorMing Lei <ming.lei@redhat.com>
Fri, 21 Mar 2025 13:53:24 +0000 (21:53 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 21 Mar 2025 20:09:24 +0000 (14:09 -0600)
commitffde32a49a145a27af07e6acfb0c1d83c26479c4
tree8921aac1fba4d614130893b34088c443416494e3
parent07754bfd9aee59063f8549f6e4d455eae636ecc7
selftests: ublk: fix starting ublk device

Firstly ublk char device node may not be created by udev yet, so wait
a while until it can be opened or timeout.

Secondly delete created ublk device in case of start failure, otherwise
the device becomes zombie.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250321135324.259677-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/file_backed.c
tools/testing/selftests/ublk/kublk.c