]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests: ublk: fix fio arguments in run_io_and_recover()
authorCaleb Sander Mateos <csander@purestorage.com>
Fri, 12 Dec 2025 17:17:02 +0000 (10:17 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 12 Dec 2025 19:50:40 +0000 (12:50 -0700)
run_io_and_recover() invokes fio with --size="${size}", but the variable
size doesn't exist. Thus, the argument expands to --size=, which causes
fio to exit immediately with an error without issuing any I/O. Pass the
value for size as the first argument to the function.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/test_common.sh
tools/testing/selftests/ublk/test_generic_04.sh
tools/testing/selftests/ublk/test_generic_05.sh
tools/testing/selftests/ublk/test_generic_11.sh

index 8a4dbd09feb0a885ec7539f1a285ed6f437fe3ab..6f1c042de40e797dc30744e31de521ae08f39c2f 100755 (executable)
@@ -333,11 +333,12 @@ run_io_and_kill_daemon()
 
 run_io_and_recover()
 {
-       local action=$1
+       local size=$1
+       local action=$2
        local state
        local dev_id
 
-       shift 1
+       shift 2
        dev_id=$(_add_ublk_dev "$@")
        _check_add_dev "$TID" $?
 
index 8b533217d4a174776714dc76331dc2d61c92c4af..baf5b156193de565a2625ac959ce608cfc269d9b 100755 (executable)
@@ -8,7 +8,7 @@ ERR_CODE=0
 
 ublk_run_recover_test()
 {
-       run_io_and_recover "kill_daemon" "$@"
+       run_io_and_recover 256M "kill_daemon" "$@"
        ERR_CODE=$?
        if [ ${ERR_CODE} -ne 0 ]; then
                echo "$TID failure: $*"
index 398e9e2b58e159046deb64b938443a0ba2b3dd4e..7b5083afc02abe8267a6dd32656cc4f6551296f0 100755 (executable)
@@ -8,7 +8,7 @@ ERR_CODE=0
 
 ublk_run_recover_test()
 {
-       run_io_and_recover "kill_daemon" "$@"
+       run_io_and_recover 256M "kill_daemon" "$@"
        ERR_CODE=$?
        if [ ${ERR_CODE} -ne 0 ]; then
                echo "$TID failure: $*"
index a00357a5ec6b826aecae5e7c2530f304aa04648b..d1f973c8c645905a4d6205ea1ee0e9402cd50e0a 100755 (executable)
@@ -8,7 +8,7 @@ ERR_CODE=0
 
 ublk_run_quiesce_recover()
 {
-       run_io_and_recover "quiesce_dev" "$@"
+       run_io_and_recover 256M "quiesce_dev" "$@"
        ERR_CODE=$?
        if [ ${ERR_CODE} -ne 0 ]; then
                echo "$TID failure: $*"