summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-12-16 10:35:07 -0700
committerJens Axboe <axboe@fb.com>2014-12-16 10:35:07 -0700
commit0162683724850b047a4f2687e3946443080e2079 (patch)
treeae4ac55ed49a85b40847d4ede54e1242ae412a5c
parentf893b76d5745811033f056ae4d4efe4f571452bd (diff)
downloadfio-0162683724850b047a4f2687e3946443080e2079.tar.gz
fio-0162683724850b047a4f2687e3946443080e2079.tar.bz2
engines/mmap: fix segfault on large devices and 32-bit archs
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--engines/mmap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/mmap.c b/engines/mmap.c
index 6464cbad..b938d6b7 100644
--- a/engines/mmap.c
+++ b/engines/mmap.c
@@ -103,6 +103,11 @@ static int fio_mmapio_prep_full(struct thread_data *td, struct io_u *io_u)
if (fio_file_partial_mmap(f))
return EINVAL;
+ if (io_u->offset != (size_t) io_u->offset ||
+ f->io_size != (size_t) f->io_size) {
+ fio_file_set_partial_mmap(f);
+ return EINVAL;
+ }
fmd->mmap_sz = f->io_size;
fmd->mmap_off = 0;