public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 0/2] two small fixes
@ 2021-10-17 20:33 Pavel Begunkov
  2021-10-17 20:33 ` [PATCH 1/2] io_uring: fail iopoll links if can't retry Pavel Begunkov
  2021-10-17 20:33 ` [PATCH 2/2] io_uring: fix async_data checks for msg setup Pavel Begunkov
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Begunkov @ 2021-10-17 20:33 UTC (permalink / raw)
  To: io-uring; +Cc: Jens Axboe, Pavel Begunkov

The first correctly attributes failed iopoll requests.
2/2 fixes a for-next bug.

Pavel Begunkov (2):
  io_uring: fail iopoll links if can't retry
  io_uring: fix async_data checks for msg setup

 fs/io_uring.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.33.1


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

* [PATCH 1/2] io_uring: fail iopoll links if can't retry
  2021-10-17 20:33 [PATCH 0/2] two small fixes Pavel Begunkov
@ 2021-10-17 20:33 ` Pavel Begunkov
  2021-10-17 20:33 ` [PATCH 2/2] io_uring: fix async_data checks for msg setup Pavel Begunkov
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Begunkov @ 2021-10-17 20:33 UTC (permalink / raw)
  To: io-uring; +Cc: Jens Axboe, Pavel Begunkov, stable

If io_rw_should_reissue() fails in iopoll path and we can't reissue we
fail the request. Don't forget to also mark it as failed, so links are
broken.

Cc: [email protected]
Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 0d7613c7355c..40b1697e7354 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2687,6 +2687,7 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long res, long res2)
 			req->flags |= REQ_F_REISSUE;
 			return;
 		}
+		req_set_fail(req);
 		req->result = res;
 	}
 
-- 
2.33.1


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

* [PATCH 2/2] io_uring: fix async_data checks for msg setup
  2021-10-17 20:33 [PATCH 0/2] two small fixes Pavel Begunkov
  2021-10-17 20:33 ` [PATCH 1/2] io_uring: fail iopoll links if can't retry Pavel Begunkov
@ 2021-10-17 20:33 ` Pavel Begunkov
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Begunkov @ 2021-10-17 20:33 UTC (permalink / raw)
  To: io-uring; +Cc: Jens Axboe, Pavel Begunkov

We should use req_has_async_data() instead of directly testing
->async_data to see if async_data has been allocated, there is one spot
slipped that doesn't follow the rule.

Fixes: 016e0451e9ed0 ("io_uring: control ->async_data with a REQ_F flag")
Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 40b1697e7354..7ead1507be9b 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4683,9 +4683,9 @@ static int io_sync_file_range(struct io_kiocb *req, unsigned int issue_flags)
 static int io_setup_async_msg(struct io_kiocb *req,
 			      struct io_async_msghdr *kmsg)
 {
-	struct io_async_msghdr *async_msg = req->async_data;
+	struct io_async_msghdr *async_msg;
 
-	if (async_msg)
+	if (req_has_async_data(req))
 		return -EAGAIN;
 	if (io_alloc_async_data(req)) {
 		kfree(kmsg->free_iov);
-- 
2.33.1


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

end of thread, other threads:[~2021-10-17 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-17 20:33 [PATCH 0/2] two small fixes Pavel Begunkov
2021-10-17 20:33 ` [PATCH 1/2] io_uring: fail iopoll links if can't retry Pavel Begunkov
2021-10-17 20:33 ` [PATCH 2/2] io_uring: fix async_data checks for msg setup Pavel Begunkov

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