summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-01-22 15:11:13 -0700
committerJens Axboe <jaxboe@fusionio.com>2011-01-22 15:11:13 -0700
commit913ea0db12596b735a030a1836bd913497b7120a (patch)
tree3a968abcf9c6dd54cee2036fce99801b330ee840
parent7c973896f9e97f7b551bf4881fc0338b748f308b (diff)
downloadfio-913ea0db12596b735a030a1836bd913497b7120a.tar.gz
fio-913ea0db12596b735a030a1836bd913497b7120a.tar.bz2
mmap: catch invalid msync() errors early
Reported-by: Bruce Cran <bruce@cran.org.uk> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r--engines/mmap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/mmap.c b/engines/mmap.c
index 059bfcfa..79238b1e 100644
--- a/engines/mmap.c
+++ b/engines/mmap.c
@@ -181,8 +181,16 @@ static int fio_mmapio_queue(struct thread_data *td, struct io_u *io_u)
static int fio_mmapio_init(struct thread_data *td)
{
+ struct thread_options *o = &td->o;
unsigned long shift, mask;
+ if ((td->o.rw_min_bs & page_mask) &&
+ (o->odirect || o->fsync_blocks || o->fdatasync_blocks)) {
+ log_err("fio: mmap options dictate a minimum block size of "
+ "%lu bytes\n", page_size);
+ return 1;
+ }
+
mmap_map_size = MMAP_TOTAL_SZ / td->o.nr_files;
mask = mmap_map_size;
shift = 0;