From cbbfe5a9c91895b382aff061bff658c211acd495 Mon Sep 17 00:00:00 2001 From: Shin'ichiro Kawasaki Date: Wed, 20 Dec 2023 09:58:45 +0900 Subject: [PATCH] zbd: avoid write with rwmixwrite=0 option Since the commit fb0259fb276a ("zbd: Ensure first I/O is write for random read/write to sequential zones"), fio issues write as the first I/O when zonemode=zbd and rw=randrw options are specified. However, fio issues the first write even when rwmixwrite=0 option is specified. Users do not expect such write and it confuses the users. To avoid the confusion, suppress the write by referring td->o.rwmix[DDIR_WRITE]. Fixes: fb0259fb276a ("zbd: Ensure first I/O is write for random read/write to sequential zones") Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20231220005846.1371456-2-shinichiro.kawasaki@wdc.com Signed-off-by: Jens Axboe --- zbd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zbd.c b/zbd.c index c4f7b12f..61b5b688 100644 --- a/zbd.c +++ b/zbd.c @@ -1876,7 +1876,8 @@ enum fio_ddir zbd_adjust_ddir(struct thread_data *td, struct io_u *io_u, if (ddir != DDIR_READ || !td_rw(td)) return ddir; - if (io_u->file->last_start[DDIR_WRITE] != -1ULL || td->o.read_beyond_wp) + if (io_u->file->last_start[DDIR_WRITE] != -1ULL || + td->o.read_beyond_wp || td->o.rwmix[DDIR_WRITE] == 0) return DDIR_READ; return DDIR_WRITE; -- 2.25.1