From 19185e0ea3a91a1d8b9c7e013a32f96bf006052a Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 12 Oct 2020 16:48:57 -0600 Subject: [PATCH 2/2] io_uring: don't clear IOCB_NOWAIT for async buffered retry If we do, and read-ahead is disabled, we can be blocking on the page to finish before making progress. This defeats the purpose of async IO. Now that we know that read-ahead will most likely trigger the IO, we can make progress even for ra_pages == 0 without punting to io-wq to satisfy the IO in a blocking fashion. Fixes: c8d317aa1887 ("io_uring: fix async buffered reads when readahead is disabled") Reported-by: Matthew Wilcox (Oracle) Signed-off-by: Jens Axboe --- fs/io_uring.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index c043d889a2eb..be70f3e38fb2 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3248,7 +3248,6 @@ static bool io_rw_should_retry(struct io_kiocb *req) wait->wait.flags = 0; INIT_LIST_HEAD(&wait->wait.entry); kiocb->ki_flags |= IOCB_WAITQ; - kiocb->ki_flags &= ~IOCB_NOWAIT; kiocb->ki_waitq = wait; return true; } -- 2.28.0