Recent changes (master)

Jens Axboe <[email protected]> Thu, 23 Apr 2026 06:00:01 -0600
Newsgroups org.kernel.vger.fio
Message-ID <[email protected]>
The following changes since commit d91ab4439af20b13dbbe55021f6c29de5b6eddeb:

  Merge branch 'check-numberio-read-only' of https://github.com/minwooim/fio (2026-04-16 22:31:44 -0400)

are available in the Git repository at:

  git://git.kernel.dk/fio.git master

for you to fetch changes up to 7b1fa07c9c7d4624fefd31d40d36742e900f6e44:

  Merge branch 'prevent_large_trim_size_and_high_iodepth_causing_oom' of https://github.com/dennischerchang/fio (2026-04-22 15:59:15 -0400)

----------------------------------------------------------------
Dennis Chang (1):
      fio: prevent OOM by not allocating buffer for TRIM range

Jens Axboe (1):
      Merge branch 'fix-trigger-timeout-segfault' of https://github.com/minwooim/fio

Minwoo Im (1):
      verify: fix segfault in timedout teardown

Vincent Fu (1):
      Merge branch 'prevent_large_trim_size_and_high_iodepth_causing_oom' of https://github.com/dennischerchang/fio

 backend.c | 5 ++++-
 fio.h     | 8 ++++++++
 verify.c  | 8 +++++++-
 3 files changed, 19 insertions(+), 2 deletions(-)

---

Diff of recent changes:

diff --git a/backend.c b/backend.c
index cad43ace..7a02ea11 100644
--- a/backend.c
+++ b/backend.c
@@ -1482,7 +1482,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 7793d35c..18196123 100644
--- a/fio.h
+++ b/fio.h
@@ -862,6 +862,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;
diff --git a/verify.c b/verify.c
index e2011a0f..76da89eb 100644
--- a/verify.c
+++ b/verify.c
@@ -1676,7 +1676,13 @@ struct all_io_list *get_all_io_list(int save_mask, size_t *sz)
 		if (save_mask != IO_LIST_ALL && (__td_index + 1) != save_mask)
 			continue;
 
-		for (int i = 0; i < td->o.iodepth; i++)
+		/*
+		 * This can be called even if --verify=none &&
+		 * --verify_state_save=0 case especially when
+		 *  --trigger-timeout= is given and it's expired.  In this
+		 *  case, td->inflight_numberio == NULL, so we should check it.
+		 */
+		for (int i = 0; td->inflight_numberio && i < td->o.iodepth; i++)
 			s->inflight[i].numberio = cpu_to_le64(atomic_load_acquire(&td->inflight_numberio[i]));
 
 		s->depth = cpu_to_le32((uint32_t) td->o.iodepth);