Skip to contentSkip to conversation

io_uring: dump sqe contents if issue fails

PATCH New Jens Axboe 1 participant 1 message Sep 11, 2021

Subsystems (3)
lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 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.

---

fs/io_uring.c +2 -0
index f795ad281038..e4fb140c25bf 100644
@@ -7064,6 +7064,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) {
 			/*
include/trace/events/io_uring.h +61 -0

73 lines not on this page · raw message

Signature · 1 line
Jens Axboe