[PATCH] Move td_verror() into io_ops->queue() hook
authorJens Axboe <jens.axboe@oracle.com>
Sun, 11 Feb 2007 00:01:57 +0000 (01:01 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Sun, 11 Feb 2007 00:01:57 +0000 (01:01 +0100)
Shows where the error occured, not where it got noticed.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/libaio.c
engines/mmap.c
engines/net.c
engines/posixaio.c
engines/sg.c
engines/splice.c
engines/sync.c
fio.c

index 47c1d4b8d8603571779b59be064173327ae24c0c..c2f47d8bc87aee1b2b76d117c1f8d7c2532ea35a 100644 (file)
@@ -115,6 +115,7 @@ static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u)
        if (ret <= 0) {
                io_u->resid = io_u->xfer_buflen;
                io_u->error = -ret;
+               td_verror(td, io_u->error);
                return 1;
        }
 
index dc1fd33a2927fc8163140875ee12dbd0e6f22684..b2143196e4cf36fc828c4a9816f4b42766bef30d 100644 (file)
@@ -68,6 +68,8 @@ static int fio_mmapio_queue(struct thread_data *td, struct io_u *io_u)
 
        if (!io_u->error)
                sd->last_io_u = io_u;
+       else
+               td_verror(td, io_u->error);
 
        return io_u->error;
 }
index 8e5ad5ee2e2518ed615496af898ab335ae3a9636..fe114a7b8c8fab5b69a8d9b508580f292a8732fb 100644 (file)
@@ -102,6 +102,8 @@ static int fio_netio_queue(struct thread_data *td, struct io_u *io_u)
 
        if (!io_u->error)
                nd->last_io_u = io_u;
+       else
+               td_verror(td, io_u->error);
 
        return io_u->error;
 }
index 71601fdd31c8df937cc08498c04d308875135d5e..2fc56cd690772e05c1881f73eff2449f14cab981 100644 (file)
@@ -151,8 +151,10 @@ static int fio_posixaio_queue(struct thread_data fio_unused *td,
        else
                ret = aio_fsync(O_SYNC, aiocb);
 
-       if (ret)
+       if (ret) {
                io_u->error = errno;
+               td_verror(td, io_u->error);
+       }
                
        return io_u->error;
 }
index d32007022aeb8388c6e0fcfef0d5f4ee50393acc..8d086bffe6cad7431cd9243932538d735e133cfa 100644 (file)
@@ -261,7 +261,12 @@ static int fio_sgio_queue(struct thread_data *td, struct io_u *io_u)
                io_u->error = EIO;
        }
 
-       return io_u->error;
+       if (io_u->error) {
+               td_verror(td, io_u->error);
+               return io_u->error;
+       }
+
+       return 0;
 }
 
 static struct io_u *fio_sgio_event(struct thread_data *td, int event)
index 026a82bb053b538ac61f83ed721f8ca4448fb8a1..432ba79b032d3381ce8114e92db6242ecfee2691 100644 (file)
@@ -152,6 +152,8 @@ static int fio_spliceio_queue(struct thread_data *td, struct io_u *io_u)
 
        if (!io_u->error)
                sd->last_io_u = io_u;
+       else
+               td_verror(td, io_u->error);
 
        return io_u->error;
 }
index 94dd71049f0cb1cf85f355ba210754150b1eec64..f689cbe7888c7f4c3fe862672160ae177f2a6e96 100644 (file)
@@ -80,6 +80,8 @@ static int fio_syncio_queue(struct thread_data *td, struct io_u *io_u)
 
        if (!io_u->error)
                sd->last_io_u = io_u;
+       else
+               td_verror(td, io_u->error);
 
        return io_u->error;
 }
diff --git a/fio.c b/fio.c
index 9c970333bb4090644fb32fec4ef9010a45214628..2aeb6f72a5b196e3052876b27c24fd266db90cfe 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -412,7 +412,6 @@ requeue:
                                io_u->xfer_buf += ret;
                                goto requeue;
                        } else {
-                               td_verror(td, io_u->error);
                                put_io_u(td, io_u);
                                break;
                        }