* [PATCH] Fix verify_backlog start verification before finish writing
@ 2014-02-05 18:28 Puthikorn Voravootivat
2014-02-05 19:35 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Puthikorn Voravootivat @ 2014-02-05 18:28 UTC (permalink / raw)
To: Jens Axboe
Cc: FIO List, Gwendal Grignou, Grant Grundler, Puthikorn Voravootivat
Due to recent fix for checking rand_seed in verify phase. In write phase,
the IO transaction will be logged before completing the actual data write.
If verify_backlog is enabled, verification may start before all data has
been written. This patch disable that fix if the verify_backlog is enabled.
Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
---
I was going to send the v2 to the last patch. But saw that you have already
applied it. So here is the additional fix.
backend.c | 7 ++++++-
io_u.c | 11 +++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/backend.c b/backend.c
index bf9d066..31b2790 100644
--- a/backend.c
+++ b/backend.c
@@ -714,10 +714,15 @@ static uint64_t do_io(struct thread_data *td)
else
td_set_runstate(td, TD_RUNNING);
+ /*
+ * Verify_backlog disabled: We need to log rand seed before the
+ * actual IO to be able to replay it correctly in the verify phase.
+ */
if (td_write(td) && io_u->ddir == DDIR_WRITE &&
td->o.do_verify &&
td->o.verify != VERIFY_NONE &&
- !td->o.experimental_verify)
+ !td->o.experimental_verify &&
+ !(td->flags & TD_F_VER_BACKLOG))
log_io_piece(td, io_u);
ret = td_io_queue(td, io_u);
diff --git a/io_u.c b/io_u.c
index f68b213..127564e 100644
--- a/io_u.c
+++ b/io_u.c
@@ -1623,6 +1623,17 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
utime_since_now(&td->start));
}
+ /*
+ * Verify_backlog enable: We need to log the write job after
+ * finishing it to prevent verifying before finish writing.
+ */
+ if (td_write(td) && idx == DDIR_WRITE &&
+ td->o.do_verify &&
+ td->o.verify != VERIFY_NONE &&
+ !td->o.experimental_verify &&
+ (td->flags & TD_F_VER_BACKLOG))
+ log_io_piece(td, io_u);
+
icd->bytes_done[idx] += bytes;
if (io_u->end_io) {
--
1.9.0.rc1.175.g0b1dcb5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix verify_backlog start verification before finish writing
2014-02-05 18:28 [PATCH] Fix verify_backlog start verification before finish writing Puthikorn Voravootivat
@ 2014-02-05 19:35 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2014-02-05 19:35 UTC (permalink / raw)
To: Puthikorn Voravootivat; +Cc: FIO List, Gwendal Grignou, Grant Grundler
On Wed, Feb 05 2014, Puthikorn Voravootivat wrote:
> Due to recent fix for checking rand_seed in verify phase. In write phase,
> the IO transaction will be logged before completing the actual data write.
> If verify_backlog is enabled, verification may start before all data has
> been written. This patch disable that fix if the verify_backlog is enabled.
Thanks, this looks good!
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-05 19:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-05 18:28 [PATCH] Fix verify_backlog start verification before finish writing Puthikorn Voravootivat
2014-02-05 19:35 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox