From: Shin'ichiro Kawasaki Date: Thu, 8 Jun 2023 07:06:07 +0000 (+0900) Subject: t/zbd: test write zone accounting of almost full zones X-Git-Tag: fio-3.36~81 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=2495bcd841f16ea1dfbb019f2fe9a307cddf15f7;p=fio.git t/zbd: test write zone accounting of almost full zones Recent commit fixed the bug of the write zone accounting for almost full zones. Add a test case which confirms the fix. Signed-off-by: Shin'ichiro Kawasaki Signed-off-by: Vincent Fu --- diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support index 86577952..cdaa0574 100755 --- a/t/zbd/test-zbd-support +++ b/t/zbd/test-zbd-support @@ -1368,6 +1368,27 @@ test63() { check_reset_count -eq 3 || return $? } +# Test write zone accounting handles almost full zones correctly. Prepare an +# almost full, but not full zone. Write to the zone with verify using larger +# block size. Then confirm fio does not report write zone accounting failure. +test64() { + local bs cap + + [ -n "$is_zbd" ] && reset_zone "$dev" -1 + + bs=$((zone_size / 8)) + cap=$(total_zone_capacity 1 $((first_sequential_zone_sector*512)) $dev) + run_fio_on_seq "$(ioengine "psync")" --rw=write --bs="$bs" \ + --size=$((zone_size)) \ + --io_size=$((cap - bs)) \ + >> "${logfile}.${test_number}" 2>&1 || return $? + + bs=$((zone_size / 2)) + run_fio_on_seq "$(ioengine "psync")" --rw=write --bs="$bs" \ + --size=$((zone_size)) --do_verify=1 --verify=md5 \ + >> "${logfile}.${test_number}" 2>&1 || return $? +} + SECONDS=0 tests=() dynamic_analyzer=()