* [PATCH] Fixes bug: stale LAST_POS(f) is not being reset.
@ 2013-09-19 21:07 Juan Casse
2013-09-20 15:20 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Juan Casse @ 2013-09-19 21:07 UTC (permalink / raw)
To: Jens Axboe; +Cc: Grant Grundler, fio, Juan Casse
Problem:
When running fio with ioengine=sync, LAST_POS(f) state is not
reset after the file is closed. This causes workloads with
readwrite=randread and loops > 1 to fail verification if the
state of LAST_POS(f) at the beginning of the next loop is the
same as the io_u->offset. If that is the case, lseek in not
invoked, but the file position is at 0 and not at io_u->offset.
Proposed Solution:
Other ioengines, such as binject and fusion-aw, set f->engine_data
to 0 when closing the file. The sync ioengin uses f->engine_data to
store the LAST_POS(f) state. The proposed solution is to set
f->engine_data = 0 when closing a file in generic_close_file().
Signed-off-by: Juan Casse <jcasse@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
---
filesetup.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/filesetup.c b/filesetup.c
index 7d3a061..33b47c9 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -444,6 +444,7 @@ int generic_close_file(struct thread_data fio_unused *td, struct fio_file *f)
f->shadow_fd = -1;
}
+ f->engine_data = 0;
return ret;
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fixes bug: stale LAST_POS(f) is not being reset.
2013-09-19 21:07 [PATCH] Fixes bug: stale LAST_POS(f) is not being reset Juan Casse
@ 2013-09-20 15:20 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2013-09-20 15:20 UTC (permalink / raw)
To: Juan Casse; +Cc: Grant Grundler, fio
On 09/19/2013 03:07 PM, Juan Casse wrote:
> Problem:
> When running fio with ioengine=sync, LAST_POS(f) state is not
> reset after the file is closed. This causes workloads with
> readwrite=randread and loops > 1 to fail verification if the
> state of LAST_POS(f) at the beginning of the next loop is the
> same as the io_u->offset. If that is the case, lseek in not
> invoked, but the file position is at 0 and not at io_u->offset.
>
> Proposed Solution:
> Other ioengines, such as binject and fusion-aw, set f->engine_data
> to 0 when closing the file. The sync ioengin uses f->engine_data to
> store the LAST_POS(f) state. The proposed solution is to set
> f->engine_data = 0 when closing a file in generic_close_file().
Thanks, good catch and fix. Applied.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-20 15:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-19 21:07 [PATCH] Fixes bug: stale LAST_POS(f) is not being reset Juan Casse
2013-09-20 15:20 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox