From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796379495; b=JW2p892QoWnavSxsUEKrjldgKBmlPHUCe423LdNwN7J4rCHpGB+7AsGcugkqtdF6watL 6dtyLBT9GiidBwoQWop9/++NGMWczlFp10dQUFmPdkJ/+yZ/nmH17Q2Kyk8cyz0Fv1g3S n+4YOshvtb4MCaKB0AJhyTfnOpkh/vDvq2ZQ6lS307sV5/2wSRFbSwigTV17SaNiVx+MG JUyZkmvlwXPCH+O/0L3u+3yo6/WWW5kGZPBDeNwl7uDlR1WtNb42f9hHki4qAI16NIx9W JqbabiO0OFYqTacvNVOztSRKkuDWFNtWHj2O/NPxSERCO1dg2osp6z/LjrwCOKUnvyw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379495; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=HnGABohmYtJ3pUzWmSkDYpGAoHdTVlTAu6sTkW+uIBA=; b=qR8xqiQShAsh6oSdG5gzuWw0fdsG9Kfi7Nr2NMCHWvUP2k4dPD0mA2bUHCtMGrEwprWc UY2xaag2L0NeErfqMKNFgzvFyN7r8vLFHrPCPkbuwuviAKkx9M2moU+5Z13GIchdEYV+T WB8GL6LcS7V8xI3emx2WLr3EgJ0tjpe/lQzl9CzzWLC3JkwfIGvoz3IUOav3d6WQfzqA9 IX0UhKvUdOL5zqqdTNWltvtcVaJ5932KspAYE7G6EtYDT1g7TkpUxY1w48tOv63V3mSAC Z5Yc83Q2CkY7hdVBx1EIT1uA5161Ho3A/d/LuzEPWRC4YPAVjRpuQ0LHqH1Do/gFVGg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=nQoOoCMz; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A3C1606A330; Fri, 4 Dec 2026 10:18:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=nQoOoCMz Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DD171F000CE; Fri, 4 Dec 2026 10:18:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796379495; bh=HnGABohmYtJ3pUzWmSkDYpGAoHdTVlTAu6sTkW+uIBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nQoOoCMzPuhMVqmVAiWjKfG84hmQUvjKxMzubU+qJ6mPPEhK8rlAjeVq6PTTsUtbt 6kDJJvWHIou3w3JfDA4IZCsqRoQOAuF/fo4s+P1yvmsWfor9NnZlevfXUbS3HzMnee Ww0gR7TbdO0MEEh7JfS+zEMgW0hv4uejA6wGK7gg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yang Xiuwei , Jens Axboe , Sasha Levin Subject: [PATCH 6.6 0017/1167] io_uring: fail soft links on negative IOU_COMPLETE results Date: Fri, 4 Dec 2026 18:50:44 +0900 Message-ID: <20261204100702.496598314@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yang Xiuwei Commit 9ed19503a7b34e1ffb2b81236843204c473b0ae0 upstream. Handlers such as fsync return IOU_COMPLETE with a negative cqe.res. The old io_req_complete() path called req_set_fail() for res < 0. After completions moved into the core, that check was dropped, so IOSQE_IO_LINK dependents kept running after the head failed. Fixes: 97b388d70b53 ("io_uring: handle completions in the core") Signed-off-by: Yang Xiuwei Link: https://patch.msgid.link/20261114041123.109163-1-yangxiuwei@kylinos.cn Signed-off-by: Jens Axboe [axboe: 6.6 has IOU_OK rather than IOU_COMPLETE] Signed-off-by: Sasha Levin --- io_uring/io_uring.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index b14651c187d4f..8bbcab4d1d7c4 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1921,9 +1921,11 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags) } if (ret == IOU_OK) { - /* not all handlers take care of the internal restart codes */ - if (unlikely(req->cqe.res <= -ERESTARTSYS)) - req->cqe.res = io_fixup_restart_res(req->cqe.res); + if (unlikely(req->cqe.res < 0)) { + if (req->cqe.res <= -ERESTARTSYS) + req->cqe.res = io_fixup_restart_res(req->cqe.res); + req_set_fail(req); + } if (issue_flags & IO_URING_F_COMPLETE_DEFER) io_req_complete_defer(req); else -- 2.53.0