The Kconfig option `SCSI_PROC_FS`, which provides the `/proc/scsi/scsi_debug` interface, has been deprecated for a long time. Instead of adding SCSI_PROC_FS as a requirement, refactor out the script to remove the scsi host to ensure all pending I/O has finished. Prevent the following error report: scsi/004 (ensure repeated TASK SET FULL results in EIO on timing out command) [failed] runtime 1.743s ... 1.935s --- tests/scsi/004.out 2025-04-04 04:36:43.171999880 +0800 +++ /root/blktests/results/nodev/scsi/004.out.bad 2025-11-13 12:46:33.807994845 +0800 @@ -1,3 +1,4 @@ Running scsi/004 Input/output error +grep: /proc/scsi/scsi_debug/0: No such file or directory Test complete Cc: Hannes Reinecke Cc: Bart Van Assche Signed-off-by: Li Zhijian --- V2: The new idea comes from Bart. Thank Bart and Shinichiro for valuable suggestions. --- tests/scsi/004 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/scsi/004 b/tests/scsi/004 index 7d0af54..72c9663 100755 --- a/tests/scsi/004 +++ b/tests/scsi/004 @@ -39,9 +39,9 @@ test() { # stop injection echo 0 > /sys/bus/pseudo/drivers/scsi_debug/opts # dd closing SCSI disk causes implicit TUR also being delayed once - while grep -q -F "in_use_bm BUSY:" "/proc/scsi/scsi_debug/${SCSI_DEBUG_HOSTS[0]}"; do - sleep 1 - done + # Remove the SCSI host to ensure all the pending I/O has finished. + host_cnt=$(cat /sys/bus/pseudo/drivers/scsi_debug/add_host) + echo -"$host_cnt" > /sys/bus/pseudo/drivers/scsi_debug/add_host echo 1 > /sys/bus/pseudo/drivers/scsi_debug/ndelay _exit_scsi_debug -- 2.44.0