Skip to content

Commit 20c53b2

Browse files
Ming Leiosandov
authored andcommitted
block/001: don't exit test with pending async scan
We have to run scan and delete together, otherwise pending async may prevent scsi_debug from being unloaded, and cause failure of 'modprobe: FATAL: Module scsi_debug is in use.' Fix the issue by always running both scan and delete together. Fixes: f3bcd8c ("block/001: wait until device is added") Reported-by: Yi Zhang <[email protected]> Signed-off-by: Ming Lei <[email protected]>
1 parent b1e29e7 commit 20c53b2

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

tests/block/001

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,10 @@ stress_scsi_debug() {
2929
scan="${scan//:/ }"
3030
while [[ ! -e "$TMPDIR/stop" ]]; do
3131
echo "${scan}" > "/sys/class/scsi_host/host${host}/scan"
32-
while [[ ! -e "$TMPDIR/stop" ]]; do
33-
if [[ -d "/sys/class/scsi_device/${target}" ]]; then
34-
echo 1 > "/sys/class/scsi_device/${target}/device/delete"
35-
break
36-
fi
32+
while [[ ! -d "/sys/class/scsi_device/${target}" ]]; do
3733
sleep 0.01
3834
done
35+
echo 1 > "/sys/class/scsi_device/${target}/device/delete"
3936
done
4037
) &
4138
done

0 commit comments

Comments
 (0)