From: Jens Axboe Date: Fri, 30 May 2008 20:03:46 +0000 (+0200) Subject: vsync: Fix issue with double issue of io_u X-Git-Tag: fio-1.21-rc4~24 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=e51cf72c29e92619534ed84a59047e62eaa05a5a vsync: Fix issue with double issue of io_u We'd lseek to the same location twice, making sequential IO lseek() and read/write to each location twice. Signed-off-by: Jens Axboe --- diff --git a/engines/sync.c b/engines/sync.c index 561e77ba..3b96ee1d 100644 --- a/engines/sync.c +++ b/engines/sync.c @@ -18,6 +18,7 @@ struct syncio_data { struct iovec *iovecs; struct io_u **io_us; unsigned int queued; + unsigned int events; unsigned long queued_bytes; unsigned long long last_offset; @@ -99,8 +100,8 @@ static int fio_vsyncio_getevents(struct thread_data *td, unsigned int min, int ret; if (min) { - ret = sd->queued; - sd->queued = 0; + ret = sd->events; + sd->events = 0; } else ret = 0; @@ -247,6 +248,8 @@ static int fio_vsyncio_commit(struct thread_data *td) ret = writev(f->fd, sd->iovecs, sd->queued); dprint(FD_IO, "vsyncio_commit: %d\n", (int) ret); + sd->events = sd->queued; + sd->queued = 0; return fio_vsyncio_end(td, ret); }