[PATCH] Improve io logging
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index 53735c6c8801c3f47568eef3fded46a136e27f2b..234822ee8ecfe9cc7099417af563cbd3aee92277 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -218,14 +218,14 @@ static int fio_io_sync(struct thread_data *td, struct fio_file *f)
 
        ret = td_io_queue(td, io_u);
        if (ret) {
+               td_verror(td, io_u->error);
                put_io_u(td, io_u);
-               td_verror(td, ret);
                return 1;
        }
 
        ret = td_io_getevents(td, 1, td->cur_depth, NULL);
        if (ret < 0) {
-               td_verror(td, -ret);
+               td_verror(td, ret);
                return 1;
        }
 
@@ -292,8 +292,8 @@ void do_verify(struct thread_data *td)
 
                ret = td_io_queue(td, io_u);
                if (ret) {
+                       td_verror(td, io_u->error);
                        put_io_u(td, io_u);
-                       td_verror(td, ret);
                        break;
                }
 
@@ -399,8 +399,8 @@ static void do_io(struct thread_data *td)
 
                ret = td_io_queue(td, io_u);
                if (ret) {
+                       td_verror(td, io_u->error);
                        put_io_u(td, io_u);
-                       td_verror(td, ret);
                        break;
                }
 
@@ -686,7 +686,7 @@ static void *thread_main(void *data)
                finish_log(td, td->slat_log, "slat");
        if (td->clat_log)
                finish_log(td, td->clat_log, "clat");
-       if (td->write_iolog)
+       if (td->write_iolog_file)
                write_iolog_close(td);
        if (td->exec_postrun)
                system(td->exec_postrun);