FAILED: patch "[PATCH] io_uring/rw: preserve partial result for iopoll" failed to apply to 6.1-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x c554246ff4c68abf71b61a89c6e39d3cf94f523e
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026071357-trapped-backhand-16db@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From c554246ff4c68abf71b61a89c6e39d3cf94f523e Mon Sep 17 00:00:00 2001
From: Michael Wigham <[email protected]>
Date: Sat, 13 Jun 2026 23:52:16 +0100
Subject: [PATCH] io_uring/rw: preserve partial result for iopoll
A partial read will store the completed byte count in io->bytes_done. The regular completion path applies io_fixup_rw_res() so that, when the following operation reaches EOF, the number of bytes already read is returned.
The iopoll completion path does not apply this fixup to the return value and can return zero instead.
Use the fixup result when updating the CQE, and the raw result for the reissue check.
io_uring/rw.c +6 -6
@@ -601,15 +601,15 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long res) { struct io_rw *rw = container_of(kiocb, struct io_rw, kiocb);struct io_kiocb *req =cmd_to_io_kiocb (rw); +int final_res =io_fixup_rw_res (req, res);if (kiocb->ki_flags &IOCB_WRITE )io_req_end_write (req); -if (unlikely (res != req->cqe.res)) { -if (res == -EAGAIN &&io_rw_should_reissue (req)) - req->flags |=REQ_F_REISSUE |REQ_F_BL_NO_RECYCLE ; -else - req->cqe.res = res; - } + +if (res == -EAGAIN &&io_rw_should_reissue (req)) + req->flags |=REQ_F_REISSUE |REQ_F_BL_NO_RECYCLE ; +else if (unlikely (final_res != req->cqe.res)) + req->cqe.res = final_res;/* order with io_iopoll_complete() checking ->iopoll_completed */ smp_store_release (&req->iopoll_completed,1 );