Fix bug with not noticing end of file

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>
diff --git a/io_u.c b/io_u.c
index 31d3b14..f71856f 100644
--- a/io_u.c
+++ b/io_u.c
@@ -142,8 +142,12 @@
 
 		if (get_next_rand_offset(td, f, ddir, &b))
 			return 1;
-	} else
+	} else {
+		if (f->last_pos >= f->real_file_size)
+			return 1;
+
 		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)