verify: fix verify issues with norandommap
authorAnkit Kumar <ankit.kumar@samsung.com>
Wed, 29 Jan 2025 18:00:24 +0000 (23:30 +0530)
committerVincent Fu <vincentfu@gmail.com>
Thu, 6 Mar 2025 18:58:43 +0000 (13:58 -0500)
When norandommap is enabled, fio logs the I/O entries in a RB tree. This
is to account for offset overlaps and overwrites. Then during verify
phase, the I/O entries are picked from the top and in this case the
smallest offset is verified first and so on. This creates a mismatch
during the header verification as the seed generated at the time of read
differs from what was logged during write. Skip seed verification in
this scenario.

fixes #1756

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
HOWTO.rst
fio.1
init.c

index 04317b1c28ef224aa0905349712aad1230017ee5..473adc4bb2c9205e3cdc843a79f5d1ff472880fd 100644 (file)
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -1564,11 +1564,13 @@ I/O type
        this option is given, fio will just get a new random offset without looking
        at past I/O history. This means that some blocks may not be read or written,
        and that some blocks may be read/written more than once. If this option is
-       used with :option:`verify` and multiple blocksizes (via :option:`bsrange`),
-       only intact blocks are verified, i.e., partially-overwritten blocks are
-       ignored.  With an async I/O engine and an I/O depth > 1, it is possible for
-       the same block to be overwritten, which can cause verification errors.  Either
-       do not use norandommap in this case, or also use the lfsr random generator.
+       used with :option:`verify` then :option:`verify_header_seed` will be
+       disabled. If this option is used with :option:`verify` and multiple blocksizes
+       (via :option:`bsrange`), only intact blocks are verified, i.e.,
+       partially-overwritten blocks are ignored. With an async I/O engine and an I/O
+       depth > 1, it is possible for the same block to be overwritten, which can
+       cause verification errors. Either do not use norandommap in this case, or also
+       use the lfsr random generator.
 
 .. option:: softrandommap=bool
 
diff --git a/fio.1 b/fio.1
index bb8fb60d8f735efb35db3e0d3530663c0cf4628e..277075ed8539e295443f3d7a562eda335380d561 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -1368,7 +1368,8 @@ Normally fio will cover every block of the file when doing random I/O. If
 this option is given, fio will just get a new random offset without looking
 at past I/O history. This means that some blocks may not be read or written,
 and that some blocks may be read/written more than once. If this option is
-used with \fBverify\fR and multiple blocksizes (via \fBbsrange\fR),
+used with \fBverify\fR then \fBverify_header_seed\fR will be disabled. If this
+option is used with \fBverify\fR and multiple blocksizes (via \fBbsrange\fR),
 only intact blocks are verified, i.e., partially-overwritten blocks are
 ignored.  With an async I/O engine and an I/O depth > 1, it is possible for
 the same block to be overwritten, which can cause verification errors.  Either
diff --git a/init.c b/init.c
index 3d6230cb6b1e3304e1212385dfb57846df9883b1..91f056e36a7eb3285294db07f286d01335dcaf30 100644 (file)
--- a/init.c
+++ b/init.c
@@ -863,12 +863,12 @@ static int fixup_options(struct thread_data *td)
                }
 
                /*
-                * Disable rand_seed check when we have verify_backlog, or
-                * zone reset frequency for zonemode=zbd.
+                * Disable rand_seed check when we have verify_backlog,
+                * zone reset frequency for zonemode=zbd, or norandommap.
                 * Unless we were explicitly asked to enable it.
                 */
                if (!td_write(td) || (td->flags & TD_F_VER_BACKLOG) ||
-                   o->zrf.u.f) {
+                   o->zrf.u.f || o->norandommap) {
                        if (!fio_option_is_set(o, verify_header_seed))
                                o->verify_header_seed = 0;
                }