summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-09-12 01:04:50 +0300
committerJens Axboe <axboe@kernel.dk>2021-10-19 14:49:52 +0300
commita87acfde949140946456859eafa5f15175d0f960 (patch)
treef3b41d525eb425c76db61e8b69ece1eeeb7abfb2 /fs
parente0d78afeb8d190164a823d5ef5821b0b3802af33 (diff)
downloadlinux-a87acfde949140946456859eafa5f15175d0f960.tar.xz
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')
-rw-r--r--fs/io_uring.c2
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) {
/*