We repeatedly re-read the last end of a file, instead of skipping
to a new one. The problem was that the offset got turned into a
block number for comparison, so we would screw up if size % bs.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
if (get_next_rand_offset(td, f, ddir, &b))
return 1;
if (get_next_rand_offset(td, f, ddir, &b))
return 1;
+ } else {
+ if (f->last_pos >= f->real_file_size)
+ return 1;
+
b = f->last_pos / td->o.min_bs[ddir];
b = f->last_pos / td->o.min_bs[ddir];
io_u->offset = (b * td->o.min_bs[ddir]) + f->file_offset;
if (io_u->offset >= f->real_file_size)
io_u->offset = (b * td->o.min_bs[ddir]) + f->file_offset;
if (io_u->offset >= f->real_file_size)