Skip to contentSkip to conversation

io_uring: ensure registered buffer import returns the IO length

PATCH New Jens Axboe 1 participant 1 message Nov 13, 2019

Subsystems (2)
lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 io_uring: ensure registered buffer import returns the IO length

A test case was reported where two linked reads with registered buffers failed the second link always. This is because we set the expected value of a request in req->result, and if we don't get this result, then we fail the dependent links. For some reason the registered buffer import returned -ERROR/0, while the normal import returns -ERROR/length. This broke linked commands with registered buffers.

Fix this by making io_import_fixed() correctly return the mapped length.

---

fs/io_uring.c +1 -1
index 57ea54d5b0fb..2c819c3c855d 100644
@@ -1230,7 +1230,7 @@ static int io_import_fixed(struct io_ring_ctx *ctx, int rw,
 		}
 	}
 
-	return 0;
+	return len;
 }
 
 static ssize_t io_import_iovec(struct io_ring_ctx *ctx, int rw,
Signature · 1 line
Jens Axboe