From bcd27f7ae1ccebd2ac1778752bf8f13fa99600e9 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 25 Feb 2014 14:01:26 -0800 Subject: [PATCH 1/1] Fixup ->open_files if not given For engines/users that add files with add_file() after the job has been initialized, ensure that we bump the allowed number of open files if it wasn't explicitly given as an option. This unbreaks the net engine after commit 002fe73409d1e made fio more strict wrt open files. Signed-off-by: Jens Axboe --- filesetup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/filesetup.c b/filesetup.c index f0e3b34f..7669d704 100644 --- a/filesetup.c +++ b/filesetup.c @@ -1230,6 +1230,13 @@ int add_file(struct thread_data *td, const char *fname, int numjob) set_already_allocated(file_name); + /* + * For adding files after the fact - if openfiles= isn't + * given as an option, ensure we allow at least one file open + */ + if (!td->o.open_files) + td->o.open_files = 1; + dprint(FD_FILE, "file %p \"%s\" added at %d\n", f, f->file_name, cur_files); -- 2.25.1