From: Shin'ichiro Kawasaki Date: Wed, 20 Dec 2023 00:58:45 +0000 (+0900) Subject: zbd: avoid write with rwmixwrite=0 option X-Git-Tag: fio-3.37~75 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=cbbfe5a9c91895b382aff061bff658c211acd495;p=fio.git 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 --- 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;