X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=464c0f2018f51672f88cdd2bd3ced44c8bceda4e;hp=8b04560907b911f8bcc7a484f71964e36d055708;hb=e77c010d2c5bcd98c72797db9146b7a556444bc5;hpb=bc3456fa06cc7777c4764da8c7b1c0fd0a3c3772 diff --git a/filesetup.c b/filesetup.c index 8b045609..464c0f20 100644 --- a/filesetup.c +++ b/filesetup.c @@ -543,8 +543,10 @@ int setup_files(struct thread_data *td) */ if (need_extend) { temp_stall_ts = 1; - log_info("%s: Laying out IO file(s) (%u file(s) / %LuMiB)\n", - td->o.name, need_extend, extend_size >> 20); + if (!terse_output) + log_info("%s: Laying out IO file(s) (%u file(s) /" + " %LuMiB)\n", td->o.name, need_extend, + extend_size >> 20); for_each_file(td, f, i) { unsigned long long old_len, extend_len; @@ -647,6 +649,7 @@ void close_and_free_files(struct thread_data *td) } td_io_close_file(td, f); + remove_file_hash(f); sfree(f->file_name); f->file_name = NULL; @@ -694,6 +697,11 @@ int add_file(struct thread_data *td, const char *fname) dprint(FD_FILE, "add file %s\n", fname); f = smalloc(sizeof(*f)); + if (!f) { + log_err("fio: smalloc OOM\n"); + assert(0); + } + f->fd = -1; dprint(FD_FILE, "resize file array to %d files\n", cur_files + 1); @@ -712,7 +720,11 @@ int add_file(struct thread_data *td, const char *fname) sprintf(file_name + len, "%s", fname); f->file_name = smalloc_strdup(file_name); - + if (!f->file_name) { + log_err("fio: smalloc OOM\n"); + assert(0); + } + get_file_type(f); switch (td->o.file_lock_mode) { @@ -905,9 +917,18 @@ void dup_files(struct thread_data *td, struct thread_data *org) struct fio_file *__f; __f = smalloc(sizeof(*__f)); - + if (!__f) { + log_err("fio: smalloc OOM\n"); + assert(0); + } + if (f->file_name) { __f->file_name = smalloc_strdup(f->file_name); + if (!__f->file_name) { + log_err("fio: smalloc OOM\n"); + assert(0); + } + __f->filetype = f->filetype; }