]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
io_uring: add comment for drain_next
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 24 Jan 2020 21:40:24 +0000 (00:40 +0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 27 Jan 2020 22:36:30 +0000 (15:36 -0700)
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>
fs/io_uring.c

index 4bde5da2c2f55068d39b2dc9a3dd77231b05254d..a700ee5fc89d61d995c8387b366fdfbbc7714ae3 100644 (file)
@@ -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;