From: Ankit Kumar Date: Tue, 28 Jan 2025 14:46:14 +0000 (+0530) Subject: init: fixup verify_offset option X-Git-Tag: fio-3.40~51 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=c0bd027f0fd001d7b41dc7a3ccd302f06041f3c5;p=fio.git init: fixup verify_offset option Verify offset should swap verification header within the verify interval. If this is not the case return error. Update the doc. accordingly. Signed-off-by: Ankit Kumar --- diff --git a/HOWTO.rst b/HOWTO.rst index 41ebabee..fb6dddcf 100644 --- a/HOWTO.rst +++ b/HOWTO.rst @@ -3931,7 +3931,8 @@ Verification .. option:: verify_offset=int Swap the verification header with data somewhere else in the block before - writing. It is swapped back before verifying. + writing. It is swapped back before verifying. This should be within the + range of :option:`verify_interval`. .. option:: verify_interval=int diff --git a/fio.1 b/fio.1 index d7485bb4..83e77678 100644 --- a/fio.1 +++ b/fio.1 @@ -3656,7 +3656,8 @@ same offset with multiple outstanding I/Os. .TP .BI verify_offset \fR=\fPint Swap the verification header with data somewhere else in the block before -writing. It is swapped back before verifying. +writing. It is swapped back before verifying. This should be within the range +of \fBverify_interval\fR. .TP .BI verify_interval \fR=\fPint Write the verification header at a finer granularity than the diff --git a/init.c b/init.c index 00a3a8c7..bf257ea1 100644 --- a/init.c +++ b/init.c @@ -873,6 +873,17 @@ static int fixup_options(struct thread_data *td) o->verify_write_sequence = 0; } + /* + * Verify header should not be offset beyond the verify + * interval. + */ + if (o->verify_offset + sizeof(struct verify_header) > + o->verify_interval) { + log_err("fio: cannot offset verify header beyond the " + "verify interval.\n"); + ret |= 1; + } + /* * Disable rand_seed check when we have verify_backlog, * zone reset frequency for zonemode=zbd, or norandommap.