X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=filesetup.c;h=1d3cc5ad9e004f1f25d862d4e9316e2ee0f68b94;hb=b158577d787beaa6d098be3f180f947f7ad80b22;hp=228e4fffe3c5e7dd509a9ac642497093aca35f87;hpb=a7194b2d3d427e7e5678c55a128639df9caf4a48;p=fio.git diff --git a/filesetup.c b/filesetup.c index 228e4fff..1d3cc5ad 100644 --- a/filesetup.c +++ b/filesetup.c @@ -1119,9 +1119,6 @@ int setup_files(struct thread_data *td) if (err) goto err_out; - if (o->read_iolog_file) - goto done; - if (td->o.zone_mode == ZONE_MODE_ZBD) { err = zbd_init_files(td); if (err) @@ -1129,6 +1126,9 @@ int setup_files(struct thread_data *td) } zbd_recalc_options_with_zone_granularity(td); + if (o->read_iolog_file) + goto done; + /* * check sizes. if the files/devices do not exist and the size * isn't passed to fio, abort. @@ -1454,7 +1454,7 @@ static void __init_rand_distribution(struct thread_data *td, struct fio_file *f) seed = jhash(f->file_name, strlen(f->file_name), 0) * td->thread_number; if (!td->o.rand_repeatable) - seed = td->rand_seeds[4]; + seed = td->rand_seeds[FIO_RAND_BLOCK_OFF]; if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) zipf_init(&f->zipf, nranges, td->o.zipf_theta.u.f, td->o.random_center.u.f, seed); @@ -1486,7 +1486,7 @@ static bool init_rand_distribution(struct thread_data *td) /* * Check if the number of blocks exceeds the randomness capability of - * the selected generator. Tausworthe is 32-bit, the others are fullly + * the selected generator. Tausworthe is 32-bit, the others are fully * 64-bit capable. */ static int check_rand_gen_limits(struct thread_data *td, struct fio_file *f, @@ -2031,11 +2031,12 @@ void dup_files(struct thread_data *td, struct thread_data *org) if (!org->files) return; - td->files = malloc(org->files_index * sizeof(f)); + td->files = calloc(org->files_index, sizeof(f)); if (td->o.file_lock_mode != FILE_LOCK_NONE) td->file_locks = malloc(org->files_index); + assert(org->files_index >= org->o.nr_files); for_each_file(org, f, i) { struct fio_file *__f;