From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 2/2] io_uring: dedup tw-based request failing
Date: Thu, 19 Aug 2021 12:56:26 +0100 [thread overview]
Message-ID: <6c53c885259f976832b8f77843061e396c200565.1629374041.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
io_req_task_timeout() closely follows io_req_task_cancel(), so remove it
and replace with io_req_task_queue_fail().
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index bdab831a1185..581c994a4e4f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -5529,12 +5529,6 @@ static int io_poll_update(struct io_kiocb *req, unsigned int issue_flags)
return 0;
}
-static void io_req_task_timeout(struct io_kiocb *req)
-{
- req_set_fail(req);
- io_req_complete_post(req, -ETIME, 0);
-}
-
static enum hrtimer_restart io_timeout_fn(struct hrtimer *timer)
{
struct io_timeout_data *data = container_of(timer,
@@ -5549,8 +5543,7 @@ static enum hrtimer_restart io_timeout_fn(struct hrtimer *timer)
atomic_read(&req->ctx->cq_timeouts) + 1);
spin_unlock_irqrestore(&ctx->timeout_lock, flags);
- req->io_task_work.func = io_req_task_timeout;
- io_req_task_work_add(req);
+ io_req_task_queue_fail(req, -ETIME);
return HRTIMER_NORESTART;
}
--
2.32.0
next prev parent reply other threads:[~2021-08-19 11:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-19 11:56 [PATCH for-next 0/2] tw handlers cleanups Pavel Begunkov
2021-08-19 11:56 ` [PATCH 1/2] io_uring: remove mutex in io_req_task_cancel() Pavel Begunkov
2021-08-19 11:56 ` Pavel Begunkov [this message]
2021-08-19 15:49 ` [PATCH for-next 0/2] tw handlers cleanups Jens Axboe
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=6c53c885259f976832b8f77843061e396c200565.1629374041.git.asml.silence@gmail.com \
[email protected] \
[email protected] \
[email protected] \
/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