From 95bcd815e5ce55d6cdd8eb83bda5ee411f37bdc9 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sun, 11 Feb 2007 01:01:57 +0100 Subject: [PATCH] [PATCH] Move td_verror() into io_ops->queue() hook Shows where the error occured, not where it got noticed. Signed-off-by: Jens Axboe --- engines/libaio.c | 1 + engines/mmap.c | 2 ++ engines/net.c | 2 ++ engines/posixaio.c | 4 +++- engines/sg.c | 7 ++++++- engines/splice.c | 2 ++ engines/sync.c | 2 ++ fio.c | 1 - 8 files changed, 18 insertions(+), 3 deletions(-) diff --git a/engines/libaio.c b/engines/libaio.c index 47c1d4b8..c2f47d8b 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -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; } diff --git a/engines/mmap.c b/engines/mmap.c index dc1fd33a..b2143196 100644 --- a/engines/mmap.c +++ b/engines/mmap.c @@ -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; } diff --git a/engines/net.c b/engines/net.c index 8e5ad5ee..fe114a7b 100644 --- a/engines/net.c +++ b/engines/net.c @@ -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; } diff --git a/engines/posixaio.c b/engines/posixaio.c index 71601fdd..2fc56cd6 100644 --- a/engines/posixaio.c +++ b/engines/posixaio.c @@ -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; } diff --git a/engines/sg.c b/engines/sg.c index d3200702..8d086bff 100644 --- a/engines/sg.c +++ b/engines/sg.c @@ -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) diff --git a/engines/splice.c b/engines/splice.c index 026a82bb..432ba79b 100644 --- a/engines/splice.c +++ b/engines/splice.c @@ -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; } diff --git a/engines/sync.c b/engines/sync.c index 94dd7104..f689cbe7 100644 --- a/engines/sync.c +++ b/engines/sync.c @@ -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 9c970333..2aeb6f72 100644 --- 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; } -- 2.25.1