public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: io_import_iovec() returns 0/-ERROR
@ 2020-02-26  0:51 Jens Axboe
  0 siblings, 0 replies; only message in thread
From: Jens Axboe @ 2020-02-26  0:51 UTC (permalink / raw)
  To: io-uring

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")
Signed-off-by: Jens Axboe <[email protected]>

--

diff --git a/fs/io_uring.c b/fs/io_uring.c
index f79ca494bb56..36917c0101fd 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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) {

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-26  0:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-26  0:51 [PATCH] io_uring: io_import_iovec() returns 0/-ERROR Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox