Recent changes (master)

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

  ci: skip new write uncorrectable tests on QEMU (2026-06-10 22:28:50 +0000)

are available in the Git repository at:

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

for you to fetch changes up to d8380abcb6756d7356961ac496904acc12181bf7:

  Merge branch 'fix/trim-with-do-verify-0' of https://github.com/minwooim/fio (2026-06-10 20:31:50 -0400)

----------------------------------------------------------------
Minwoo Im (1):
      backend: log trim @io_u to io_hist even `do_verify=0`

Vincent Fu (1):
      Merge branch 'fix/trim-with-do-verify-0' of https://github.com/minwooim/fio

 backend.c        | 15 +++++++++++++--
 t/verify-trim.py | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 66 insertions(+), 3 deletions(-)

---

Diff of recent changes:

diff --git a/backend.c b/backend.c
index 8ff3bc12..7f41bdfa 100644
--- a/backend.c
+++ b/backend.c
@@ -1315,9 +1315,14 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)
 		 * Always log IO before it's issued, so we know the specific
 		 * order of it. The logged unit will track when the IO has
 		 * completed.
+		 *
+		 * Trim command is determined by @io_u loggged in the @io_hist
+		 * based on the percentage of the given value to
+		 * --trim_percentage=<%>.  Log @io_u for trim command even in
+		 * --do_verify=0 case.
 		 */
 		if (td_write(td) && io_u->ddir == DDIR_WRITE &&
-		    td->o.do_verify &&
+		    (td->o.do_verify || td->trim_verify) &&
 		    td->o.verify != VERIFY_NONE &&
 		    !td->o.experimental_verify)
 			log_io_piece(td, io_u);
@@ -1911,8 +1916,14 @@ static uint64_t do_dry_run(struct thread_data *td)
 			td->ts.total_io_u[io_u->ddir]++;
 		}
 
+		/*
+		 * Trim command is determined by @io_u loggged in the @io_hist
+		 * based on the percentage of the given value to
+		 * --trim_percentage=<%>.  Log @io_u for trim command even in
+		 * --do_verify=0 case.
+		 */
 		if (td_write(td) && io_u->ddir == DDIR_WRITE &&
-		    td->o.do_verify &&
+		    (td->o.do_verify || td->trim_verify) &&
 		    td->o.verify != VERIFY_NONE &&
 		    !td->o.experimental_verify) {
 			if (!verify_state_should_skip(td, io_u->numberio))
diff --git a/t/verify-trim.py b/t/verify-trim.py
index cd98722a..e95b2709 100755
--- a/t/verify-trim.py
+++ b/t/verify-trim.py
@@ -47,6 +47,7 @@ VERIFY_OPT_LIST = [
     'trim_backlog_batch',
     'trim_verify_zero',
     'number_ios',
+    'do_verify',
 ]
 
 class VerifyTrimTest(FioJobCmdTest):
@@ -208,7 +209,58 @@ TEST_LIST = [
             },
         "test_class": VerifyTrimTest,
     },
-
+    {
+        # do_verify=0: trim must still be issued when trim_percentage=100
+        "test_id": 200,
+        "fio_opts": {
+            "rw": "write",
+            "do_verify": 0,
+            "trim_percentage": 100,
+            "trim_backlog": 1,
+            "number_ios": 64,
+            "output-format": "json",
+            },
+        "test_class": VerifyTrimTest,
+    },
+    {
+        # do_verify=0: trim must still be issued when trim_percentage=100
+        "test_id": 201,
+        "fio_opts": {
+            "rw": "randwrite",
+            "do_verify": 0,
+            "trim_percentage": 100,
+            "trim_backlog": 1,
+            "number_ios": 64,
+            "output-format": "json",
+            },
+        "test_class": VerifyTrimTest,
+    },
+    {
+        # do_verify=0: trim must still be issued when trim_percentage=50
+        "test_id": 202,
+        "fio_opts": {
+            "rw": "write",
+            "do_verify": 0,
+            "trim_percentage": 50,
+            "trim_backlog": 1,
+            "number_ios": 64,
+            "output-format": "json",
+            },
+        "test_class": VerifyTrimTest,
+    },
+    {
+        # do_verify=0: trim must still be issued when trim_percentage=50
+        "test_id": 203,
+        "fio_opts": {
+            "rw": "randwrite",
+            "do_verify": 0,
+            "trim_percentage": 50,
+            "trim_backlog": 1,
+            "number_ios": 64,
+            "output-format": "json",
+            },
+        "test_class": VerifyTrimTest,
+    },
 ]