From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>,
[email protected], [email protected]
Subject: [PATCH v2 1/5] io_uring: add missing io_req_cancelled()
Date: Sun, 16 Feb 2020 01:01:18 +0300 [thread overview]
Message-ID: <da924cbc76ca1e5b2d1528ffd88bcb180704e531.1581785642.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
fallocate_finish() is missing cancellation check. Add it.
It's safe to do that, as only flags setup and sqe fields copy are done
before it gets into __io_fallocate().
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5a826017ebb8..7a132be72863 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2517,6 +2517,9 @@ static void io_fallocate_finish(struct io_wq_work **workptr)
struct io_kiocb *nxt = NULL;
int ret;
+ if (io_req_cancelled(req))
+ return;
+
ret = vfs_fallocate(req->file, req->sync.mode, req->sync.off,
req->sync.len);
if (ret < 0)
@@ -2904,6 +2907,7 @@ static void io_close_finish(struct io_wq_work **workptr)
struct io_kiocb *req = container_of(*workptr, struct io_kiocb, work);
struct io_kiocb *nxt = NULL;
+ /* not cancellable, don't do io_req_cancelled() */
__io_close_finish(req, &nxt);
if (nxt)
io_wq_assign_next(workptr, nxt);
--
2.24.0
next prev parent reply other threads:[~2020-02-15 22:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-15 22:01 [PATCH v2 0/5] async punting improvements for io_uring Pavel Begunkov
2020-02-15 22:01 ` Pavel Begunkov [this message]
2020-02-16 17:15 ` [PATCH v2 1/5] io_uring: add missing io_req_cancelled() Jens Axboe
2020-02-16 19:09 ` Pavel Begunkov
2020-02-15 22:01 ` [PATCH v2 2/5] io_uring: remove REQ_F_MUST_PUNT Pavel Begunkov
2020-02-15 22:01 ` [PATCH v2 3/5] io_uring: don't call work.func from sync ctx Pavel Begunkov
2020-02-15 22:01 ` [PATCH v2 4/5] io_uring: don't do full *prep_worker() from io-wq Pavel Begunkov
2020-02-15 22:01 ` [PATCH v2 5/5] io_uring: remove req->in_async Pavel Begunkov
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=da924cbc76ca1e5b2d1528ffd88bcb180704e531.1581785642.git.asml.silence@gmail.com \
[email protected] \
[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