Fix bug with rw sequence offset and io_limit
authorJens Axboe <axboe@fb.com>
Sun, 28 Sep 2014 22:18:43 +0000 (16:18 -0600)
committerJens Axboe <axboe@fb.com>
Sun, 28 Sep 2014 22:18:43 +0000 (16:18 -0600)
commitac002339c382d56ffcbf2b15a55d07d9d8c2eac6
treed3221e2b493def9a25e3362c70367366c8b6c19f
parentbc095aab789a2e7d036c6d499f6c124a0c2d5de0
Fix bug with rw sequence offset and io_limit

If you do:

dd if=/dev/zero of=/dev/shm/1M bs=1M count=1
fio --bs=4k --rw=write:4k --filename=/dev/shm/1M --name=go --io_limit=2M

then fio will exit prematurely after having done 128 4KB ios,
so only 512KB are read. This is because after 128 ios, we have
reache the end of the file. Handle this case and wrap around
properly.

Signed-off-by: Jens Axboe <axboe@fb.com>
io_u.c