Skip to contentSkip to conversation

io_uring: io_import_iovec() returns 0/-ERROR

PATCH New Jens Axboe 1 participant 1 message Feb 26, 2020

Subsystems (2)
lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 io_uring: io_import_iovec() returns 0/-ERROR

Unlike the other core import helpers, io_import_iovec() returns 0 on success, not the length imported. This means that links that depend on the result of non-vec based IORING_OP_{READ,WRITE} that were added for 5.5 get errored when they should not be.

Fixes 3a6820f2bb8a ("io_uring: add non-vectored read/write commands")

--

fs/io_uring.c +1 -1
index f79ca494bb56..36917c0101fd 100644
@@ -2075,7 +2075,7 @@ static ssize_t io_import_iovec(int rw, struct io_kiocb *req,
 		ssize_t ret;
 		ret = import_single_range(rw, buf, sqe_len, *iovec, iter);
 		*iovec = NULL;
-		return ret;
+		return ret < 0 ? ret : sqe_len;
 	}
 
 	if (req->io) {
Signature · 1 line
Jens Axboe