Fix bad random offset generation for file map
authorJens Axboe <axboe@kernel.dk>
Wed, 12 Oct 2011 07:42:33 +0000 (09:42 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 12 Oct 2011 07:46:01 +0000 (09:46 +0200)
commit15b87723551b424d0db4c53577b567e670c7d4d8
treeca60db0e201322984467664b417ba7b0e0b736d0
parent5efce23f88563bc08f64e122297fcfbea32fdd4f
Fix bad random offset generation for file map

If OS_RAND_MAX and FRAND_MAX are different, then ensure that
we use the right one. If not, our lookup cache could be outside
the allowed range, thus causing a segfault by indexing
f->file_map beyond end of the array.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_u.c