Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, Yang Xiuwei <yangxiuwei@kylinos.cn>,
	Jens Axboe <axboe@kernel.dk>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.1 0019/1059] io_uring: fail soft links on negative IOU_COMPLETE results
Date: Fri,  4 Dec 2026 18:52:30 +0900	[thread overview]
Message-ID: <20261204100644.533028640@linuxfoundation.org> (raw)
In-Reply-To: <20261204100643.980430235@linuxfoundation.org>

6.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yang Xiuwei <yangxiuwei@kylinos.cn>

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 <yangxiuwei@kylinos.cn>
Link: https://patch.msgid.link/20261114041123.109163-1-yangxiuwei@kylinos.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[axboe: 6.1 has IOU_OK rather than IOU_COMPLETE]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 c59fbe6905de9..cedb21c1295ef 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1756,9 +1756,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




  parent reply	other threads:[~2026-12-04 10:19 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  9:52 [PATCH 6.1 0000/1059] 6.1.194-rc1 review Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0001/1059] RDMA/erdma: Use IRQ-safe XArray helpers for QP and CQ tables Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0002/1059] netfilter: nft_ct: expectation timeouts are passed in milliseconds Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0003/1059] netfilter: nft_ct: move custom expectation support to helper Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0004/1059] mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0005/1059] drm/amdgpu: Check cs flags Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0006/1059] bpf: Drop inet_conn_established from lsm sleepable hooks Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0007/1059] mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0008/1059] irqchip/sifive-plic: Avoid signed shift in interrupt enable mask Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0009/1059] fs: aio: reject partial mremap to avoid Null-pointer-dereference error Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0010/1059] Revert "SUNRPC: svcauth_gss: enforce krb5 token minimum length" Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0011/1059] Revert "SUNRPC: Convert unwrap_priv_data() to use xdr_stream" Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0012/1059] SUNRPC: svcauth_gss: enforce krb5 token minimum length Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0013/1059] mm/ksm: simplify break_ksm() to not rely on VM_FAULT_WRITE Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0014/1059] mm/ksm: fix KSM COW breaking with userfaultfd-wp via FAULT_FLAG_UNSHARE Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0015/1059] mm/ksm: fix userfaultfd protection during merge and unmerge Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0016/1059] udf: validate VAT inode size for old VAT format Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0017/1059] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0018/1059] io_uring: enable toggle of iowait usage when waiting on CQEs Greg Kroah-Hartman
2026-12-04  9:52 ` Greg Kroah-Hartman [this message]
2026-12-04  9:52 ` [PATCH 6.1 0020/1059] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0021/1059] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0022/1059] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0023/1059] staging: media: atomisp: use array3_size() for overflow-safe allocation Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0024/1059] fs/9p: switch vfsmount to use v9fs_get_new_inode Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0025/1059] fs/9p: rework qid2ino logic Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0026/1059] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0027/1059] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0028/1059] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0029/1059] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0030/1059] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0031/1059] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0032/1059] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0033/1059] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0034/1059] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0035/1059] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0036/1059] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0037/1059] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0038/1059] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0039/1059] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0040/1059] ptp: prevent possible ABBA deadlock in ptp_clock_freerun() Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0041/1059] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0042/1059] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0043/1059] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0044/1059] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0045/1059] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0046/1059] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0047/1059] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0048/1059] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0049/1059] bpf: Dont look for the SRH again in the End.BPF helpers Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0050/1059] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0051/1059] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap() Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0052/1059] ipv4: Unmask upper DSCP bits in input route lookup Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0053/1059] ipv4: Convert ip_route_input_noref() to dscp_t Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0054/1059] bpf: Reset skb->cb after an lwt prog pushes an IP header Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0055/1059] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0056/1059] bpf: Move the transport header with the moved headers Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0057/1059] bpf: Check the offset in bpf_skb_generic_{push,pop}() Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0058/1059] spi: Fix ACPI SPI resources using relative path Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0059/1059] spi: acpi: only look up the IRQ of confirmed SPI devices Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261204100644.533028640@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=axboe@kernel.dk \
    --cc=patches@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yangxiuwei@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox