Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL
       [not found] <20250809182636.209767-1-sumanth.gavini.ref@yahoo.com>
@ 2025-08-09 18:26 ` Sumanth Gavini
  2025-08-09 18:38   ` kernel test robot
  2025-08-10  0:42   ` [PATCH " Sasha Levin
  0 siblings, 2 replies; 6+ messages in thread
From: Sumanth Gavini @ 2025-08-09 18:26 UTC (permalink / raw)
  To: axboe, asml.silence
  Cc: Sumanth Gavini, io-uring, linux-kernel, stable, skhan,
	david.hunter.linux, John Garry

commit 	bcb0fda3c2da9fe4721d3e73d80e778c038e7d27 upstream.

The IOPOLL path posts CQEs when the io_kiocb is marked as completed,
so it cannot rely on the usual retry that non-IOPOLL requests do for
read/write requests.

If -EAGAIN is received and the request should be retried, go through
the normal completion path and let the normal flush logic catch it and
reissue it, like what is done for !IOPOLL reads or writes.

Fixes: d803d123948f ("io_uring/rw: handle -EAGAIN retry at IO completion time")
Reported-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/io-uring/2b43ccfa-644d-4a09-8f8f-39ad71810f41@oracle.com/
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sumanth Gavini <sumanth.gavini@yahoo.com>
---
 io_uring/rw.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/io_uring/rw.c b/io_uring/rw.c
index 4ff3442ac2ee..6a84c4a39ce9 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -326,11 +326,10 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long 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)) {
+		if (res == -EAGAIN && io_rw_should_reissue(req))
 			req->flags |= REQ_F_REISSUE | REQ_F_PARTIAL_IO;
-			return;
-		}
-		req->cqe.res = res;
+		else
+			req->cqe.res = res;
 	}
 
 	/* order with io_iopoll_complete() checking ->iopoll_completed */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL
  2025-08-09 18:26 ` [PATCH 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL Sumanth Gavini
@ 2025-08-09 18:38   ` kernel test robot
  2025-08-09 20:54     ` [PATCH v2 " Sumanth Gavini
  2025-08-10  0:42   ` [PATCH " Sasha Levin
  1 sibling, 1 reply; 6+ messages in thread
From: kernel test robot @ 2025-08-09 18:38 UTC (permalink / raw)
  To: Sumanth Gavini; +Cc: stable, oe-kbuild-all

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-3

Rule: The upstream commit ID must be specified with a separate line above the commit text.
Subject: [PATCH 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL
Link: https://lore.kernel.org/stable/20250809182636.209767-1-sumanth.gavini%40yahoo.com

Please ignore this mail if the patch is not relevant for upstream.

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL
  2025-08-09 18:38   ` kernel test robot
@ 2025-08-09 20:54     ` Sumanth Gavini
  2025-08-10  0:42       ` Sasha Levin
  2025-08-12 10:49       ` Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: Sumanth Gavini @ 2025-08-09 20:54 UTC (permalink / raw)
  To: axboe, asml.silence, lkp
  Cc: Sumanth Gavini, io-uring, linux-kernel, stable, skhan,
	david.hunter.linux, oe-kbuild-all, John Garry

commit bcb0fda3c2da9fe4721d3e73d80e778c038e7d27 upstream.

The IOPOLL path posts CQEs when the io_kiocb is marked as completed,
so it cannot rely on the usual retry that non-IOPOLL requests do for
read/write requests.

If -EAGAIN is received and the request should be retried, go through
the normal completion path and let the normal flush logic catch it and
reissue it, like what is done for !IOPOLL reads or writes.

Fixes: d803d123948f ("io_uring/rw: handle -EAGAIN retry at IO completion time")
Reported-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/io-uring/2b43ccfa-644d-4a09-8f8f-39ad71810f41@oracle.com/
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sumanth Gavini <sumanth.gavini@yahoo.com>
---
Changes in v2:
- Removed the extra space before commit-id in message, No codes changes
- Link to v1:https://lore.kernel.org/all/20250809182636.209767-1-sumanth.gavini@yahoo.com/

---
 io_uring/rw.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/io_uring/rw.c b/io_uring/rw.c
index 4ff3442ac2ee..6a84c4a39ce9 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -326,11 +326,10 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long 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)) {
+		if (res == -EAGAIN && io_rw_should_reissue(req))
 			req->flags |= REQ_F_REISSUE | REQ_F_PARTIAL_IO;
-			return;
-		}
-		req->cqe.res = res;
+		else
+			req->cqe.res = res;
 	}
 
 	/* order with io_iopoll_complete() checking ->iopoll_completed */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL
  2025-08-09 20:54     ` [PATCH v2 " Sumanth Gavini
@ 2025-08-10  0:42       ` Sasha Levin
  2025-08-12 10:49       ` Greg KH
  1 sibling, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2025-08-10  0:42 UTC (permalink / raw)
  To: stable; +Cc: Sasha Levin

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected.
No action required from the submitter.

The upstream commit SHA1 provided is correct: bcb0fda3c2da9fe4721d3e73d80e778c038e7d27

WARNING: Author mismatch between patch and upstream commit:
Backport author: Sumanth Gavini <sumanth.gavini@yahoo.com>
Commit author: Jens Axboe <axboe@kernel.dk>

Status in newer kernel trees:
6.15.y | Present (exact SHA1)
6.12.y | Not found

Note: The patch differs from the upstream commit:
---
1:  bcb0fda3c2da ! 1:  941165821178 io_uring/rw: ensure reissue path is correctly handled for IOPOLL
    @@
      ## Metadata ##
    -Author: Jens Axboe <axboe@kernel.dk>
    +Author: Sumanth Gavini <sumanth.gavini@yahoo.com>
     
      ## Commit message ##
         io_uring/rw: ensure reissue path is correctly handled for IOPOLL
     
    +    commit bcb0fda3c2da9fe4721d3e73d80e778c038e7d27 upstream.
    +
         The IOPOLL path posts CQEs when the io_kiocb is marked as completed,
         so it cannot rely on the usual retry that non-IOPOLL requests do for
         read/write requests.
    @@ Commit message
         Reported-by: John Garry <john.g.garry@oracle.com>
         Link: https://lore.kernel.org/io-uring/2b43ccfa-644d-4a09-8f8f-39ad71810f41@oracle.com/
         Signed-off-by: Jens Axboe <axboe@kernel.dk>
    +    Signed-off-by: Sumanth Gavini <sumanth.gavini@yahoo.com>
     
      ## io_uring/rw.c ##
     @@ io_uring/rw.c: static void io_complete_rw_iopoll(struct kiocb *kiocb, long res)
    @@ io_uring/rw.c: static void io_complete_rw_iopoll(struct kiocb *kiocb, long res)
      	if (unlikely(res != req->cqe.res)) {
     -		if (res == -EAGAIN && io_rw_should_reissue(req)) {
     +		if (res == -EAGAIN && io_rw_should_reissue(req))
    - 			req->flags |= REQ_F_REISSUE | REQ_F_BL_NO_RECYCLE;
    + 			req->flags |= REQ_F_REISSUE | REQ_F_PARTIAL_IO;
     -			return;
     -		}
     -		req->cqe.res = res;

---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| origin/linux-6.6.y        | Success     | Success    |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL
  2025-08-09 18:26 ` [PATCH 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL Sumanth Gavini
  2025-08-09 18:38   ` kernel test robot
@ 2025-08-10  0:42   ` Sasha Levin
  1 sibling, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2025-08-10  0:42 UTC (permalink / raw)
  To: stable; +Cc: Sasha Levin

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected.
No action required from the submitter.

Found matching upstream commit: bcb0fda3c2da9fe4721d3e73d80e778c038e7d27

WARNING: Author mismatch between patch and found commit:
Backport author: Sumanth Gavini <sumanth.gavini@yahoo.com>
Commit author: Jens Axboe <axboe@kernel.dk>

Status in newer kernel trees:
6.15.y | Present (exact SHA1)
6.12.y | Not found

Note: The patch differs from the upstream commit:
---
1:  bcb0fda3c2da ! 1:  9067ba27246b io_uring/rw: ensure reissue path is correctly handled for IOPOLL
    @@
      ## Metadata ##
    -Author: Jens Axboe <axboe@kernel.dk>
    +Author: Sumanth Gavini <sumanth.gavini@yahoo.com>
     
      ## Commit message ##
         io_uring/rw: ensure reissue path is correctly handled for IOPOLL
     
    +    commit  bcb0fda3c2da9fe4721d3e73d80e778c038e7d27 upstream.
    +
         The IOPOLL path posts CQEs when the io_kiocb is marked as completed,
         so it cannot rely on the usual retry that non-IOPOLL requests do for
         read/write requests.
    @@ Commit message
         Reported-by: John Garry <john.g.garry@oracle.com>
         Link: https://lore.kernel.org/io-uring/2b43ccfa-644d-4a09-8f8f-39ad71810f41@oracle.com/
         Signed-off-by: Jens Axboe <axboe@kernel.dk>
    +    Signed-off-by: Sumanth Gavini <sumanth.gavini@yahoo.com>
     
      ## io_uring/rw.c ##
     @@ io_uring/rw.c: static void io_complete_rw_iopoll(struct kiocb *kiocb, long res)
    @@ io_uring/rw.c: static void io_complete_rw_iopoll(struct kiocb *kiocb, long res)
      	if (unlikely(res != req->cqe.res)) {
     -		if (res == -EAGAIN && io_rw_should_reissue(req)) {
     +		if (res == -EAGAIN && io_rw_should_reissue(req))
    - 			req->flags |= REQ_F_REISSUE | REQ_F_BL_NO_RECYCLE;
    + 			req->flags |= REQ_F_REISSUE | REQ_F_PARTIAL_IO;
     -			return;
     -		}
     -		req->cqe.res = res;

---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| origin/linux-6.6.y        | Success     | Success    |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL
  2025-08-09 20:54     ` [PATCH v2 " Sumanth Gavini
  2025-08-10  0:42       ` Sasha Levin
@ 2025-08-12 10:49       ` Greg KH
  1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2025-08-12 10:49 UTC (permalink / raw)
  To: Sumanth Gavini
  Cc: axboe, asml.silence, lkp, io-uring, linux-kernel, stable, skhan,
	david.hunter.linux, oe-kbuild-all, John Garry

On Sat, Aug 09, 2025 at 03:54:18PM -0500, Sumanth Gavini wrote:
> commit bcb0fda3c2da9fe4721d3e73d80e778c038e7d27 upstream.
> 
> The IOPOLL path posts CQEs when the io_kiocb is marked as completed,
> so it cannot rely on the usual retry that non-IOPOLL requests do for
> read/write requests.
> 
> If -EAGAIN is received and the request should be retried, go through
> the normal completion path and let the normal flush logic catch it and
> reissue it, like what is done for !IOPOLL reads or writes.
> 
> Fixes: d803d123948f ("io_uring/rw: handle -EAGAIN retry at IO completion time")
> Reported-by: John Garry <john.g.garry@oracle.com>
> Link: https://lore.kernel.org/io-uring/2b43ccfa-644d-4a09-8f8f-39ad71810f41@oracle.com/
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Sumanth Gavini <sumanth.gavini@yahoo.com>
> ---
> Changes in v2:
> - Removed the extra space before commit-id in message, No codes changes
> - Link to v1:https://lore.kernel.org/all/20250809182636.209767-1-sumanth.gavini@yahoo.com/

We can not take patches ONLY for older kernel trees and not newer ones,
otherwise you will have a regression when moving to a newer one.  I've
dropped this now, please submit for all relevant trees.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-08-12 10:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250809182636.209767-1-sumanth.gavini.ref@yahoo.com>
2025-08-09 18:26 ` [PATCH 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL Sumanth Gavini
2025-08-09 18:38   ` kernel test robot
2025-08-09 20:54     ` [PATCH v2 " Sumanth Gavini
2025-08-10  0:42       ` Sasha Levin
2025-08-12 10:49       ` Greg KH
2025-08-10  0:42   ` [PATCH " Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox