From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=109.224.244.20 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795977233; b=vMzsalPeAordcZjvoHbevt6luvEl7BmzqRzTjjgHGIZgi4Gk9tBv3FDvU6xaUjqB2HkU a5L/vDHia1Z1jOp128mAkO3vn8gaYndfr6i/KRAFLmnOxW6QUEwSQthaMm/y/a4dw39oF LYnYHWAr8DC0Pc0SNOLuKe3wJ0tsUsQYGPs2gkRlx9D6IynEFkzEDqmohAI8CYj19IxP4 kLYldkRjA1+UBXu3k9d5sPmNjd2KN8JKK6IGkCUSFROmGo9POZ9keTPZide0n3oOXRb3r Y9fNtzTCpvdBb5urTTHZYZ8IEcO1XA8LkU9M0gxYvucph8OYkCWuEnR/Ap4WEPGkL8w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795977233; h=DMARC-Filter:DKIM-Signature:Date:To:From:Cc:Subject:Message-ID: In-Reply-To:References:Feedback-ID:X-Pm-Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=3j8LgInb1ufhrf8AJE2UyXcSjVvS0cMMM3B2YUBGVFk=; b=CWlEh7V3YSMEoxDjq7niatVm+Itpjkn0JZzwORhtOdNA6O9eUBJMneMcDj46YqOlbr1h ep5LzK7JPj+YOBUaU4cEvF5dKUe3fYFrXqbG5gHgQyM7opE2LhbvOzZxrkIyYuIExaMoA pjJpelx9mDnsH9enmFcGgM+2Bz/dZ8/fRapS3FmAyf6AA6vxacOSqrFAsjqn+r3dAl/uC 6IS+fSplVAbD1MlHWGc+SUzLckIo04+ye0AfI6ZIvddd0Ge03PsehOSWXpvPe6/+V972B 9L+Gu2INx1fenECV1nzbd92qoktX2gG29zTRloUuDodYe4AejdRdV5zvUuSMPG7A5gg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=a7snv.com; spf=pass smtp.mailfrom=a7snv.com; dkim=pass header.d=a7snv.com header.i=@a7snv.com header.a=rsa-sha256 header.s=protonmail header.b="gIyRQKH/"; arc=none smtp.remote-ip=109.224.244.20 Received: from mail-24420.protonmail.ch (mail-24420.protonmail.ch [109.224.244.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC9D1606A325 for ; Sun, 29 Nov 2026 18:33:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CC9D1606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=a7snv.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=a7snv.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=a7snv.com header.i=@a7snv.com header.a=rsa-sha256 header.s=protonmail header.b=gIyRQKH/ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=a7snv.com; s=protonmail; t=1795977230; x=1796236430; bh=3j8LgInb1ufhrf8AJE2UyXcSjVvS0cMMM3B2YUBGVFk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=gIyRQKH/gvnmcZ9oprZ8QjyMBDkMvXXqOPZwbaeyNxT5T9MZ7qgIGuOXyntMwq/Ze ItNY+aFTsPqLenjnoSYF92yz5McVEAwrVScJ4PKPUqzNuntf5eRosn0uSoHZHYJq2S MZ3Pw1lEERogOSGVj+zsDbDOgSGK+xRS/DXJyXAN+mQCf4rM7rh9Zo2hO87yJVfPOF 5wGuBYVuykAfMjuaIUmjZj1pSVL2f8ZeprKSYyVDVhIoch/Ue5BzERutRChlM5G5bl ZECHmP7BKijAe3md7S+ScyZXgSkSXZbkFfKgaSt7fzaGxqsekGRoOOrnFXNIhhCYow 0yYsSMDj387lw== Date: Sun, 29 Nov 2026 18:33:44 +0000 To: Jens Axboe From: Yun Wang Cc: Pavel Begunkov , Hao Xu , Mengmeng Zhao , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] io_uring: clear REQ_F_FORCE_ASYNC when reissuing a request Message-ID: <20261129183214.3303492-3-arsenova@a7snv.com> In-Reply-To: <20261129183214.3303492-1-arsenova@a7snv.com> References: <20261129183214.3303492-1-arsenova@a7snv.com> Feedback-ID: 235448903:user:proton X-Pm-Message-ID: 4a78adb6b0e59ac41eddf2fbc6edf9d0dc53b11f X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable When a read or write is reissued, io_free_batch_list() clears REQ_F_REISSUE and queues the request to io-wq, but leaves REQ_F_FORCE_ASYNC set. For a request submitted with IOSQE_ASYNC on a file that implements ->poll(), io_wq_submit_work() then issues it with IO_URING_F_NONBLOCK again, so the retry that should be blocking is another nonblocking attempt with IOCB_NOWAIT set. io_rw_should_reissue() allows a reissue after a nonblocking attempt, so such a request is still reissued forever when its completion keeps returning -EAGAIN or -EOPNOTSUPP. REQ_F_REISSUE means the nonblocking attempt has been made and the request should now be issued from blocking context. Clear REQ_F_FORCE_ASYNC together with it, so that io-wq issues the retry blocking. The request is already being queued to io-wq at this point; the only other effect is that the retry no longer sets IO_WQ_WORK_CONCURRENT. FUSE regular files implement ->poll(). With a FUSE server that has FUSE_ASYNC_DIO and FOPEN_DIRECT_IO and answers every READ with -EOPNOTSUPP or -EAGAIN, an IORING_OP_READ with IOSQE_ASYNC is still reissued until the server stops failing with the previous patch alone. With both patches it fails after two attempts. Fixes: d803d123948f ("io_uring/rw: handle -EAGAIN retry at IO completion ti= me") Cc: stable@vger.kernel.org Signed-off-by: Yun Wang --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 5db57bf675f0..c08714d10d5b 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1187,7 +1187,7 @@ static void io_free_batch_list(struct io_ring_ctx *ct= x, =09=09if (unlikely(req->flags & IO_REQ_CLEAN_SLOW_FLAGS)) { =09=09=09if (req->flags & REQ_F_REISSUE) { =09=09=09=09node =3D req->comp_list.next; -=09=09=09=09req->flags &=3D ~REQ_F_REISSUE; +=09=09=09=09req->flags &=3D ~(REQ_F_REISSUE | REQ_F_FORCE_ASYNC); =09=09=09=09io_queue_iowq(req); =09=09=09=09continue; =09=09=09} --=20 2.56.1