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);
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;