test: check all offsets touched for randtrimwrite
[fio.git] / backend.c
index 4a6a61b83580ac3edc24a4a176cd2edcafb62bb3..ec535bcc47955bc8bf15b64a76f43686ae5b2368 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -971,9 +971,11 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)
                total_bytes += td->o.size;
 
        /* In trimwrite mode, each byte is trimmed and then written, so
-        * allow total_bytes to be twice as big */
-       if (td_trimwrite(td))
+        * allow total_bytes or number of ios to be twice as big */
+       if (td_trimwrite(td)) {
                total_bytes += td->total_io_size;
+               td->o.number_ios *= 2;
+       }
 
        while ((td->o.read_iolog_file && !flist_empty(&td->io_log_list)) ||
                (!flist_empty(&td->trim_list)) || !io_issue_bytes_exceeded(td) ||
@@ -2333,25 +2335,8 @@ static void run_threads(struct sk_out *sk_out)
        for_each_td(td, i) {
                print_status_init(td->thread_number - 1);
 
-               if (!td->o.create_serialize) {
-                       /*
-                        *  When operating on a single rile in parallel,
-                        *  perform single-threaded early setup so that
-                        *  when setup_files() does not run into issues
-                        *  later.
-                       */
-                       if (!i && td->o.nr_files == 1) {
-                               if (setup_shared_file(td)) {
-                                       exit_value++;
-                                       if (td->error)
-                                               log_err("fio: pid=%d, err=%d/%s\n",
-                                                       (int) td->pid, td->error, td->verror);
-                                       td_set_runstate(td, TD_REAPED);
-                                       todo--;
-                               }
-                       }
+               if (!td->o.create_serialize)
                        continue;
-               }
 
                if (fio_verify_load_state(td))
                        goto reap;
@@ -2468,10 +2453,8 @@ reap:
                                                        strerror(ret));
                        } else {
                                pid_t pid;
-                               struct fio_file **files;
                                void *eo;
                                dprint(FD_PROCESS, "will fork\n");
-                               files = td->files;
                                eo = td->eo;
                                read_barrier();
                                pid = fork();
@@ -2482,9 +2465,6 @@ reap:
                                        _exit(ret);
                                } else if (i == fio_debug_jobno)
                                        *fio_debug_jobp = pid;
-                               // freeing previously allocated memory for files
-                               // this memory freed MUST NOT be shared between processes, only the pointer itself may be shared within TD
-                               free(files);
                                free(eo);
                                free(fd);
                                fd = NULL;