Re: blktests scsi/007 failure

Chaitanya Kulkarni
2023-04-14T08:09:39Z

On 4/14/2023 12:36 AM, Shin'ichiro Kawasaki wrote:
> Hello Bart,
>
> Recently, I built a new blktests trial environment on QEMU. With this
> environment, I observe scsi/007 failure. FYI, let me share blktests output [1]
> and kernel message [2].
>
> I found the failure depends on kernel configs for debug such as KASAN. When I
> enable KASAN, the test case fails. When I disable KASAN, the test case passes.
> It looks that the failure depends on the slow kernel (and/or slow machine).
>
> The test case sets 1 second to the block layer timeout to trigger the SCSI error
> handler. It also sets 3 seconds to scsi_debug delay assuming the error handler
> completes before the 3 seconds. From the kernel message, it looks that the error
> handler takes longer than the 3 seconds delay, so I/O completes as success
> before the error handler completion. This I/O success is not expected then the
> test case fails. As a trial, I extended the scsi_debug delay time to 10 seconds,
> then I observed the test case passes.
>
> Do you expect the I/O success by slow SCSI error handler? If so, the test case
> needs improvement by extending the scsi_debug delay time.
>
>

I faced the same problem, but increased timeout it is passing :-

blktests (master) # ./check scsi/007
scsi/007 (Trigger
the SCSI error handler) [failed]
runtime ... 38.529s

--- tests/scsi/007.out 2022-07-18
16:14:37.204230234 -0700
+++ /root/blktests/results/nodev/scsi/007.out.bad
2023-04-14 01:03:26.518991337 -0700
@@ -1,3 +1,3 @@
Running scsi/007

-Reading from scsi_debug failed

+Reading from scsi_debug succeeded

Test complete
blktests (master) # vim
tests/scsi/007

blktests (master) # git diff

diff --git a/tests/scsi/007 b/tests/scsi/007

index e7088a1..1aa3e03 100755
---
a/tests/scsi/007
+++ b/tests/scsi/007

@@ -41,7 +41,7 @@ test() {

echo 1 > "/sys/class/block/$dev/queue/io_timeout"

echo "I/O timeout = $(<"/sys/class/block/$dev/queue/io_timeout")"
>>"$FULL" # Change
the scsi_debug delay to 3 seconds.
- delay_s=3

+ delay_s=10

freq=$(config_hz)

jdelay=$((delay_s * "${freq}"))
echo
"CONFIG_HZ=${freq} jdelay=${jdelay}" >>"$FULL"

blktests (master) # ./check scsi/007
scsi/007 (Trigger
the SCSI error handler) [passed]
runtime 21.264s ... 21.267s

blktests (master) #

blktests (master) #

you can give it a try to see if it fixes the problem ..

-ck