io_ur: make sure that sync errors are noticed upfront
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 23c4ae2d96a8b18fb9e0c185e0a5864527fb2707..6f5fc94d9a3e87bf68e3a5cdd2149579ac855720 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -990,6 +990,9 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u)
                }
        }
 
+       if (td->o.fdp)
+               fdp_fill_dspec_data(td, io_u);
+
        if (io_u->offset + io_u->buflen > io_u->file->real_file_size) {
                dprint(FD_IO, "io_u %p, off=0x%llx + len=0x%llx exceeds file size=0x%llx\n",
                        io_u,
@@ -1367,8 +1370,8 @@ static struct fio_file *__get_next_file(struct thread_data *td)
                if (td->o.file_service_type == FIO_FSERVICE_SEQ)
                        goto out;
                if (td->file_service_left) {
-                 td->file_service_left--;
-                 goto out;
+                       td->file_service_left--;
+                       goto out;
                }
        }
 
@@ -2024,6 +2027,8 @@ static void io_completed(struct thread_data *td, struct io_u **io_u_ptr,
        }
 
        if (ddir_sync(ddir)) {
+               if (io_u->error)
+                       goto error;
                td->last_was_sync = true;
                if (f) {
                        f->first_write = -1ULL;
@@ -2079,6 +2084,7 @@ static void io_completed(struct thread_data *td, struct io_u **io_u_ptr,
                                icd->error = ret;
                }
        } else if (io_u->error) {
+error:
                icd->error = io_u->error;
                io_u_log_error(td, io_u);
        }