Don't set FIO_FILE_extend when create_on_open= option is set
authorTomohiro Kusumi <tkusumi@tuxera.com>
Tue, 7 Mar 2017 20:13:03 +0000 (22:13 +0200)
committerJens Axboe <axboe@fb.com>
Fri, 10 Mar 2017 21:43:37 +0000 (14:43 -0700)
FIO_FILE_extend gets set and later cleared only when create_on_open=
is disabled (which is default). If create_on_open=1 is set this flag
could be set for the entire runtime, but this flag is basically
designed to be enabled only during setup time.

(If there's no "Layint out IO file..." message, both FIO_FILE_extend
and need_extend probably aren't even needed, as files can be extended
at the moment when these flag/variable are set)

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
filesetup.c

index fab9c5dec70b844aa40004ef98cc1794234927c3..f42f5d8f8bbc3ac1101689351bba3ffe39602dd5 100644 (file)
@@ -966,9 +966,9 @@ int setup_files(struct thread_data *td)
                        if (!o->create_on_open) {
                                need_extend++;
                                extend_size += (f->io_size + f->file_offset);
                        if (!o->create_on_open) {
                                need_extend++;
                                extend_size += (f->io_size + f->file_offset);
+                               fio_file_set_extend(f);
                        } else
                                f->real_file_size = f->io_size + f->file_offset;
                        } else
                                f->real_file_size = f->io_size + f->file_offset;
-                       fio_file_set_extend(f);
                }
        }
 
                }
        }