On Mon, Apr 20 2009, Carl Henrik Lunde wrote: > Hi! fio crashed with this configuration. I notice there are a > multiple variables counting the number of files, so I don't know which > one to use. nr_files *seems* safe? > > diff --git a/filesetup.c b/filesetup.c > index af23191..eb8774a 100644 > --- a/filesetup.c > +++ b/filesetup.c > @@ -685,8 +685,8 @@ int add_file(struct thread_data *td, const char *fname) > > f->fd = -1; > > - if (td->files_size <= td->files_index) { > - int new_size = td->o.nr_files; > + if (td->files_size <= td->o.nr_files) { > + int new_size = td->o.nr_files + 1; > > dprint(FD_FILE, "resize file array to %d files\n", new_size); Woops, that is indeed an off-by-one! I have added your patch, thanks. Your reading of the code is correct. ->o.nr_files is the total number of files. -- Jens Axboe -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html