Skip to content

Commit 7984b8d

Browse files
zhijianli88kawasaki
authored andcommitted
scsi/004: Remove reliance on deprecated /proc/scsi/scsi_debug
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 <[email protected]> Cc: Bart Van Assche <[email protected]> Signed-off-by: Li Zhijian <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent 5483b2b commit 7984b8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/scsi/004

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ test() {
3939
# stop injection
4040
echo 0 > /sys/bus/pseudo/drivers/scsi_debug/opts
4141
# dd closing SCSI disk causes implicit TUR also being delayed once
42-
while grep -q -F "in_use_bm BUSY:" "/proc/scsi/scsi_debug/${SCSI_DEBUG_HOSTS[0]}"; do
43-
sleep 1
44-
done
42+
# Remove the SCSI host to ensure all the pending I/O has finished.
43+
host_cnt=$(cat /sys/bus/pseudo/drivers/scsi_debug/add_host)
44+
echo -"$host_cnt" > /sys/bus/pseudo/drivers/scsi_debug/add_host
4545
echo 1 > /sys/bus/pseudo/drivers/scsi_debug/ndelay
4646
_exit_scsi_debug
4747

0 commit comments

Comments
 (0)