t/zbd: avoid test case 45 failure
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 6 Oct 2023 07:13:20 +0000 (16:13 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Fri, 13 Oct 2023 21:31:47 +0000 (17:31 -0400)
commit50b94305b08a746c21a2c644ffb3cb56915d86ee
treec8cf05197b8ebeb256e5cff4acac7dcaeab0f900
parent16b9f29dab1d105951da663474ec243942fda400
t/zbd: avoid test case 45 failure

When zonemode=zbd option is not specified, random writes to zoned block
devices fail because writes to sequential write required zones shall
happen only at write pointers. Randomly chosen write addresses do not
match with the write pointers, then fail. On such failures, fio prints
out the message below and tell users how to avoid the failures:

    "fio: first I/O failed. If .* is a zoned block device, consider --zonemode=zbd".

The test case 45 in t/zbd/test-zbd-support confirms the message is
printed when the first random write command to a sequential write
required zone fails. However, the random write can succeed very rarely
since the randomly chosen write address can be same as the write pointer
address. For example, a zoned block device with 1MB zone size with 4KB
block size device can have the first random write at write pointer with
ratio of 4KB/1MB = 1/256. This causes sporadic test case failures.

Avoid the failures by two changes. Firstly, change the random write
range from a zone to whole sequential write required zones to reduce the
failure ratio. Secondly, repeat the test if the message is not printed
by the accidental write success. As the test repeated, failure ratio is
multiplied and the failure ratio becomes as small as it can be ignored.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20231006071320.425270-1-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
t/zbd/test-zbd-support