aboutsummaryrefslogtreecommitdiffstats
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-01-25 00:40:24 +0300
committerJens Axboe <axboe@kernel.dk>2020-01-27 15:36:30 -0700
commit8cdf2193a3335b4cfb6e023b41ac293d0843d287 (patch)
tree28b71b8e09fadea98f8906fe6fa9bf03438110a3 /fs/io_uring.c
parentio_uring: don't attempt to copy iovec for READ/WRITE (diff)
downloadlinux-dev-8cdf2193a3335b4cfb6e023b41ac293d0843d287.tar.xz
linux-dev-8cdf2193a3335b4cfb6e023b41ac293d0843d287.zip
io_uring: add comment for drain_next
Draining the middle of a link is tricky, so leave a comment there Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r--fs/io_uring.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 4bde5da2c2f5..a700ee5fc89d 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4629,6 +4629,13 @@ err_req:
if (*link) {
struct io_kiocb *head = *link;
+ /*
+ * Taking sequential execution of a link, draining both sides
+ * of the link also fullfils IOSQE_IO_DRAIN semantics for all
+ * requests in the link. So, it drains the head and the
+ * next after the link request. The last one is done via
+ * drain_next flag to persist the effect across calls.
+ */
if (sqe_flags & IOSQE_IO_DRAIN) {
head->flags |= REQ_F_IO_DRAIN;
ctx->drain_next = 1;