diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-09-11 16:04:50 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-19 05:49:52 -0600 |
commit | a87acfde949140946456859eafa5f15175d0f960 (patch) | |
tree | f3b41d525eb425c76db61e8b69ece1eeeb7abfb2 /fs/io_uring.c | |
parent | e0d78afeb8d190164a823d5ef5821b0b3802af33 (diff) | |
download | lwn-a87acfde949140946456859eafa5f15175d0f960.tar.gz lwn-a87acfde949140946456859eafa5f15175d0f960.zip |
io_uring: dump sqe contents if issue fails
I recently had to look at a production problem where a request ended
up getting the dreaded -EINVAL error on submit. The most used and
hence useless of error codes, as it just tells you that something
was wrong with your request, but not more than that.
Let's dump the full sqe contents if we run into an issue failure,
that'll allow easier diagnosing of a wide variety of issues.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index d4631a55a692..5daee36c1f33 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -7117,6 +7117,8 @@ static int io_submit_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req, ret = io_init_req(ctx, req, sqe); if (unlikely(ret)) { fail_req: + trace_io_uring_req_failed(sqe, ret); + /* fail even hard links since we don't submit */ if (link->head) { /* |