From b9c5b64452f483162cf9841cbdd44db6b72fd67c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 18 Feb 2008 14:13:08 +0100 Subject: [PATCH] Fix random location generation with offset != 0 Signed-off-by: Jens Axboe --- io_u.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_u.c b/io_u.c index 8f10bfdc..a56a6f2d 100644 --- a/io_u.c +++ b/io_u.c @@ -44,7 +44,7 @@ static void mark_random_map(struct thread_data *td, struct io_u *io_u) unsigned int blocks; unsigned int nr_blocks; - block = io_u->offset / (unsigned long long) min_bs; + block = (io_u->offset - f->file_offset) / (unsigned long long) min_bs; blocks = 0; nr_blocks = (io_u->buflen + min_bs - 1) / min_bs; -- 2.25.1