From be943a3ef5d94d8a9fefa11dc004789f66beb8e6 Mon Sep 17 00:00:00 2001 From: Shin'ichiro Kawasaki Date: Wed, 20 Dec 2023 09:58:46 +0900 Subject: [PATCH] t/zbd: add test case to confirm no write with rwmixwrite=0 option The previous commit fixed the issue of the unexpected write with options zonemode=zbd, rw=randrw and rwmixwrite=0. Add a test to confirm the fix. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20231220005846.1371456-3-shinichiro.kawasaki@wdc.com Signed-off-by: Jens Axboe --- t/zbd/test-zbd-support | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support index 2f15a191..532860eb 100755 --- a/t/zbd/test-zbd-support +++ b/t/zbd/test-zbd-support @@ -1561,6 +1561,29 @@ test67() { grep -q 'Exceeded max_active_zones limit' "${logfile}.${test_number}" } +# Test rw=randrw and rwmixwrite=0 options do not issue write I/O unit +test68() { + local off size + + require_zbd || return "$SKIP_TESTCASE" + + reset_zone "${dev}" -1 + + # Write some data as preparation + off=$((first_sequential_zone_sector * 512)) + size=$min_seq_write_size + run_one_fio_job "$(ioengine "psync")" --rw=write --offset="$off" \ + --io_size="$size" --zonemode=strided \ + --zonesize="$zone_size" --zonerange="$zone_size" \ + >> "${logfile}.${test_number}" 2>&1 || return $? + # Run random mixed read and write specifying zero write ratio + run_fio_on_seq "$(ioengine "psync")" --rw=randrw --rwmixwrite=0 \ + --time_based --runtime=1s \ + >> "${logfile}.${test_number}" 2>&1 || return $? + # "WRITE:" shall be recoreded only once for the preparation + [[ $(grep -c "WRITE:" "${logfile}.${test_number}") == 1 ]] +} + SECONDS=0 tests=() dynamic_analyzer=() -- 2.25.1