Fix divide-by-zero
authorJens Axboe <jens.axboe@oracle.com>
Tue, 20 Mar 2007 13:38:11 +0000 (14:38 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 20 Mar 2007 13:38:11 +0000 (14:38 +0100)
Another file creation crap out, this really needs a rewrite and
soon.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c

index 6c0af85c545748c75cd2215b7befe711a1748f28..289db8781d82535e5929db7cbc8f7bd45329920d 100644 (file)
@@ -178,7 +178,7 @@ static int create_files(struct thread_data *td)
         * unless specifically asked for overwrite, let normal io extend it
         */
        can_extend = !td->o.overwrite && !(td->io_ops->flags & FIO_NOEXTEND);
-       if (can_extend) {
+       if (can_extend && new_files) {
                for_each_file(td, f, i) {
                        if (fill_file_size(td, f, &total_file_size, new_files)) {
                                log_info("fio: limited to %d files\n", i);