Recent changes (master)

Jens Axboe <[email protected]> Fri, 3 Jul 2026 06:00:01 -0600
Newsgroups org.kernel.vger.fio
Message-ID <[email protected]>
The following changes since commit f80c50d9ff50a746cd1a111f1986648963bbf7dd:

  Merge branch 'fix-issue-1542' of https://github.com/cenhuil/fio (2026-06-30 12:23:27 -0600)

are available in the Git repository at:

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

for you to fetch changes up to ed3e687f27802ae0daa60ae96ae9b798ee1b6511:

  Merge branch 'fix-pending-log-iodepth-assert' of https://github.com/SAY-5/fio (2026-07-02 08:46:38 -0600)

----------------------------------------------------------------
Jens Axboe (1):
      Merge branch 'fix-pending-log-iodepth-assert' of https://github.com/SAY-5/fio

Sai Asish Y (1):
      iolog: size pending log larger than iodepth to avoid log assertion

 iolog.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

---

Diff of recent changes:

diff --git a/iolog.c b/iolog.c
index 36fcad37..cc13ecbb 100644
--- a/iolog.c
+++ b/iolog.c
@@ -876,8 +876,16 @@ void setup_log(struct io_log **log, struct log_params *p,
 		struct io_logs *__p;
 
 		__p = calloc(1, sizeof(*l->pending));
-		if (l->td->o.iodepth > DEF_LOG_ENTRIES)
-			def_samples = roundup_pow2(l->td->o.iodepth);
+		/*
+		 * Up to iodepth in-flight IOs can log a sample into the pending
+		 * log before regrow_logs() runs, and get_cur_log() asserts there
+		 * is always room for one more (nr_samples < max_samples), so the
+		 * buffer must be strictly larger than iodepth. roundup_pow2() of
+		 * a power-of-2 iodepth (1024, 2048, ...) returns iodepth itself,
+		 * which overflows and trips the assertion; round up iodepth + 1.
+		 */
+		if (l->td->o.iodepth >= DEF_LOG_ENTRIES)
+			def_samples = roundup_pow2(l->td->o.iodepth + 1);
 		__p->max_samples = def_samples;
 		__p->log = calloc(__p->max_samples, log_entry_sz(l));
 		l->pending = __p;