From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47B5E1ED38 for ; Tue, 25 Jul 2023 10:58:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC356C433C9; Tue, 25 Jul 2023 10:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690282737; bh=GK9zxzn5jzu6GhyDJM2nmVT57/bcYqOWS6jtDsWv8HA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vUTCIFKCkrucD8nHCVVb/V7JebqP4JFLUvxJCuIAdX1ZWFHHSbkAh0moyfyWSb7GL UXKdyiXCBGcc0pE/E381sTeiQMBu//IVJLgllQvLwVZbU1RmWoEsPFCHtBneAxYkPt GeNNWPdh5rQi+xXeiy2xUuIlCQbsJcX7ZNwQMfuE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jens Axboe Subject: [PATCH 6.1 001/183] io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq Date: Tue, 25 Jul 2023 12:43:49 +0200 Message-ID: <20230725104507.808879285@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230725104507.756981058@linuxfoundation.org> References: <20230725104507.756981058@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Jens Axboe commit a9be202269580ca611c6cebac90eaf1795497800 upstream. io-wq assumes that an issue is blocking, but it may not be if the request type has asked for a non-blocking attempt. If we get -EAGAIN for that case, then we need to treat it as a final result and not retry or arm poll for it. Cc: stable@vger.kernel.org # 5.10+ Link: https://github.com/axboe/liburing/issues/897 Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- io_uring/io_uring.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1803,6 +1803,14 @@ fail: ret = io_issue_sqe(req, issue_flags); if (ret != -EAGAIN) break; + + /* + * If REQ_F_NOWAIT is set, then don't wait or retry with + * poll. -EAGAIN is final for that case. + */ + if (req->flags & REQ_F_NOWAIT) + break; + /* * We can get EAGAIN for iopolled IO even though we're * forcing a sync submission from here, since we can't