fix verify_only when using ioengine=mmap
authorBarak Pinhas <barak@e8storage.com>
Tue, 5 Dec 2017 12:23:22 +0000 (14:23 +0200)
committerBarak Pinhas <barak@e8storage.com>
Tue, 5 Dec 2017 12:23:22 +0000 (14:23 +0200)
verify_only was opening the file with O_RDONLY and the mmap
engine was trying to mmap it with PROT_READ | PROTWRITE hence
getting -EACCESS and failing the job

engines/mmap.c

index bc038f4febac88d68167f30e09d212942bbce582..51606e12ff316c3ff537ec328103b17e4c3b1ba0 100644 (file)
@@ -33,9 +33,9 @@ static int fio_mmap_file(struct thread_data *td, struct fio_file *f,
        struct fio_mmap_data *fmd = FILE_ENG_DATA(f);
        int flags = 0;
 
-       if (td_rw(td))
+       if (td_rw(td) && !td->o.verify_only)
                flags = PROT_READ | PROT_WRITE;
-       else if (td_write(td)) {
+       else if (td_write(td) && !td->o.verify_only) {
                flags = PROT_WRITE;
 
                if (td->o.verify != VERIFY_NONE)