[PATCH 09/21] verify: fix verify issues with norandommap

Ankit Kumar <[email protected]>
Newsgroups org.kernel.vger.fio
Message-ID <[email protected]>
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 <[email protected]>
---
 HOWTO.rst | 12 +++++++-----
 fio.1     |  3 ++-
 init.c    |  6 +++---
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/HOWTO.rst b/HOWTO.rst
index 6d462af3..fa6b44a5 100644
--- 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 3fbc1657..07f09f07 100644
--- 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 3d6230cb..91f056e3 100644
--- 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;
 		}
-- 
2.25.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.