diff --git a/backend.c b/backend.c index 6dd078c45e..41f506fcd4 100644 --- a/backend.c +++ b/backend.c @@ -1467,7 +1467,10 @@ int init_io_u_buffers(struct thread_data *td) char *p; max_units = td->o.iodepth; - max_bs = td_max_bs(td); + if (td->trim_verify && td->o.trim_zero) + max_bs = td_max_bs(td); + else + max_bs = td_max_rw_bs(td); min_write = td->o.min_bs[DDIR_WRITE]; td->orig_buffer_size = (unsigned long long) max_bs * (unsigned long long) max_units; diff --git a/fio.h b/fio.h index 8708f04880..227414534b 100644 --- a/fio.h +++ b/fio.h @@ -861,6 +861,14 @@ static inline bool should_check_rate(struct thread_data *td) return (td->flags & TD_F_CHECK_RATE) != 0; } +/* + * This function considers only read and write block sizes. + */ +static inline unsigned long long td_max_rw_bs(struct thread_data *td) +{ + return max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]); +} + static inline unsigned long long td_max_bs(struct thread_data *td) { unsigned long long max_bs;