t/zbd: avoid test case 31 failure with small devices
[fio.git] / filesetup.c
index 14c7610849218194c475366d8fe2f641084fa6ba..cb42a852c8cf3728571e54f55103e17d802ef4c4 100644 (file)
@@ -749,6 +749,11 @@ open_again:
                if (!read_only)
                        flags |= O_RDWR;
 
+               if (td->o.verify_only) {
+                       flags &= ~O_RDWR;
+                       flags |= O_RDONLY;
+               }
+
                if (f->filetype == FIO_TYPE_FILE && td->o.allow_create)
                        flags |= O_CREAT;
 
@@ -1406,8 +1411,8 @@ done:
 
        td_restore_runstate(td, old_state);
 
-       if (td->o.fdp) {
-               err = fdp_init(td);
+       if (td->o.dp_type != FIO_DP_NONE) {
+               err = dp_init(td);
                if (err)
                        goto err_out;
        }
@@ -1447,9 +1452,8 @@ static void __init_rand_distribution(struct thread_data *td, struct fio_file *f)
 
        nranges = (fsize + range_size - 1ULL) / range_size;
 
-       seed = jhash(f->file_name, strlen(f->file_name), 0) * td->thread_number;
-       if (!td->o.rand_repeatable)
-               seed = td->rand_seeds[FIO_RAND_BLOCK_OFF];
+       seed = jhash(f->file_name, strlen(f->file_name), 0) * td->thread_number *
+               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);