From 196ccc44e70333cc87f9d417967bd06288602dac Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Fri, 15 Jun 2018 15:00:25 -0600 Subject: [PATCH] fio.h: also check trim operations in fio_ro_check IO engines call fio_ro_check to ensure that the data direction set in the thread data structure permits writes before proceeding with a write io_u. This patch makes fio_ro_check ensure that the data direction also permits trims before proceeding with a trim io_u. --- fio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fio.h b/fio.h index 9727f6c6..51b8fdc7 100644 --- a/fio.h +++ b/fio.h @@ -533,7 +533,8 @@ extern bool eta_time_within_slack(unsigned int time); static inline void fio_ro_check(const struct thread_data *td, struct io_u *io_u) { - assert(!(io_u->ddir == DDIR_WRITE && !td_write(td))); + assert(!(io_u->ddir == DDIR_WRITE && !td_write(td)) && + !(io_u->ddir == DDIR_TRIM && !td_trim(td))); } #define REAL_MAX_JOBS 4096 -- 2.25.1