filesetup: ensure that we catch a file flagged for extend
authorJens Axboe <axboe@fb.com>
Wed, 3 Aug 2016 15:53:34 +0000 (09:53 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 3 Aug 2016 15:53:34 +0000 (09:53 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
filesetup.c

index 1ecdda61c3f460f8ae03dda4a6a5cce9c7fd5278..f32d874c66c86e35b1fcba0b9d16be09102bcd5b 100644 (file)
@@ -900,11 +900,12 @@ int setup_files(struct thread_data *td)
                if (f->filetype == FIO_TYPE_FILE &&
                    (f->io_size + f->file_offset) > f->real_file_size &&
                    !(td->io_ops->flags & FIO_DISKLESSIO)) {
                if (f->filetype == FIO_TYPE_FILE &&
                    (f->io_size + f->file_offset) > f->real_file_size &&
                    !(td->io_ops->flags & FIO_DISKLESSIO)) {
-                       if (!o->create_on_open) {
-                               need_extend++;
+                       if (!o->create_on_open)
                                extend_size += (f->io_size + f->file_offset);
                                extend_size += (f->io_size + f->file_offset);
-                       else
+                       else
                                f->real_file_size = f->io_size + f->file_offset;
                                f->real_file_size = f->io_size + f->file_offset;
+
+                       need_extend++;
                        fio_file_set_extend(f);
                }
        }
                        fio_file_set_extend(f);
                }
        }