verify: disable header seed checking instead of overwriting it
authorAnkit Kumar <ankit.kumar@samsung.com>
Fri, 7 Feb 2025 17:53:13 +0000 (23:23 +0530)
committerVincent Fu <vincentfu@gmail.com>
Thu, 6 Mar 2025 18:58:43 +0000 (13:58 -0500)
The existing header seed is overwritten if zone reset frequency is set or
if verify backlog is enabled. Disable verify header seed check for these
scenarios, unless there is an explicit request to enable it.

Note: There is no fio behavior change intended by this patch.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
init.c
verify.c

diff --git a/init.c b/init.c
index dc3e7ed18572eb3d405d618e429975b40ed730c6..99661ca89bef00cc9a8fe9444f9cd7a1ccaac79a 100644 (file)
--- a/init.c
+++ b/init.c
@@ -858,6 +858,17 @@ static int fixup_options(struct thread_data *td)
                        if (!fio_option_is_set(o, verify_write_sequence))
                                o->verify_write_sequence = 0;
                }
+
+               /*
+                * Disable rand_seed check when we have verify_backlog, or
+                * zone reset frequency for zonemode=zbd.
+                * Unless we were explicitly asked to enable it.
+                */
+               if (!td_rw(td) || (td->flags & TD_F_VER_BACKLOG) ||
+                   o->zrf.u.f) {
+                       if (!fio_option_is_set(o, verify_header_seed))
+                               o->verify_header_seed = 0;
+               }
        }
 
        if (td->o.oatomic) {
index 49d4498224b9c1d10105bba0e15ea1b10cba608d..928bdd543c9a86e1eb09a6520aaef95d7c0fdfc6 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -934,14 +934,6 @@ int verify_io_u(struct thread_data *td, struct io_u **io_u_ptr)
                        memswp(p, p + td->o.verify_offset, header_size);
                hdr = p;
 
-               /*
-                * Make rand_seed check pass when have verify_backlog or
-                * zone reset frequency for zonemode=zbd.
-                */
-               if (!td_rw(td) || (td->flags & TD_F_VER_BACKLOG) ||
-                   td->o.zrf.u.f)
-                       io_u->rand_seed = hdr->rand_seed;
-
                if (td->o.verify != VERIFY_PATTERN_NO_HDR) {
                        ret = verify_header(io_u, td, hdr, hdr_num, hdr_inc);
                        if (ret)