From: Jens Axboe Date: Mon, 9 May 2016 19:31:01 +0000 (-0600) Subject: io_u: if we're doing backwards IO, wrap to end (not start) X-Git-Tag: fio-2.10~35 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=b0a84f48509d76032455842f1482901e3ab12afd;p=fio.git io_u: if we're doing backwards IO, wrap to end (not start) If we have a job with a start file offset and we're doing holed IO, we want to wrap to the start offset for forwards holes, but to the end for backwards holes. Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index eb15dc28..f9870e70 100644 --- a/io_u.c +++ b/io_u.c @@ -371,10 +371,15 @@ static int get_next_seq_offset(struct thread_data *td, struct fio_file *f, /* * If we reach beyond the end of the file * with holed IO, wrap around to the - * beginning again. + * beginning again. If we're doing backwards IO, + * wrap to the end. */ - if (pos >= f->real_file_size) - pos = f->file_offset; + if (pos >= f->real_file_size) { + if (o->ddir_seq_add > 0) + pos = f->file_offset; + else + pos = f->real_file_size + o->ddir_seq_add; + } } *offset = pos;