backend: fix verify issue during readwrite
authorAnkit Kumar <ankit.kumar@samsung.com>
Tue, 28 Jan 2025 19:41:36 +0000 (01:11 +0530)
committerVincent Fu <vincentfu@gmail.com>
Thu, 6 Mar 2025 18:58:43 +0000 (13:58 -0500)
In readwrite mode if specified io_size > size, offsets can overlap.
This will result in verify errors. Add check to handle this case.

Fixes: d782b76f ("Don break too early in readwrite mode")

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

index f5cfffdb947f7b71d31317939196d2a1099f18fc..b75eea809d54fef60979293616a9b878bac42019 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -978,8 +978,11 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)
        if (td_write(td) && td_random(td) && td->o.norandommap)
                total_bytes = max(total_bytes, (uint64_t) td->o.io_size);
 
-       /* Don't break too early if io_size > size */
-       if (td_rw(td) && !td_random(td))
+       /*
+        * Don't break too early if io_size > size. The exception is when
+        * verify is enabled.
+        */
+       if (td_rw(td) && !td_random(td) && td->o.verify == VERIFY_NONE)
                total_bytes = max(total_bytes, (uint64_t)td->o.io_size);
 
        /*