From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 1/4] io_uring: mark ->work uninitialised after cleanup
Date: Sat, 25 Jul 2020 14:41:58 +0300 [thread overview]
Message-ID: <95fc105c8a8cb7d04ae552ff8dd92e5d782e81b4.1595677308.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
Remove REQ_F_WORK_INITIALIZED after io_req_clean_work(). That's a cold
path but is safer for those using io_req_clean_work() out of
*dismantle_req()/*io_free(). And for the same reason zero work.fs
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index c7e8e9a1b27b..59f1f473ffc7 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1141,7 +1141,9 @@ static void io_req_clean_work(struct io_kiocb *req)
spin_unlock(&req->work.fs->lock);
if (fs)
free_fs_struct(fs);
+ req->work.fs = NULL;
}
+ req->flags &= ~REQ_F_WORK_INITIALIZED;
}
static void io_prep_async_work(struct io_kiocb *req)
@@ -4969,7 +4971,6 @@ static int io_poll_add(struct io_kiocb *req)
/* ->work is in union with hash_node and others */
io_req_clean_work(req);
- req->flags &= ~REQ_F_WORK_INITIALIZED;
INIT_HLIST_NODE(&req->hash_node);
ipt.pt._qproc = io_poll_queue_proc;
--
2.24.0
next prev parent reply other threads:[~2020-07-25 11:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-25 11:41 [PATCH 0/4] 5.9 fixes Pavel Begunkov
2020-07-25 11:41 ` Pavel Begunkov [this message]
2020-07-25 11:41 ` [PATCH 2/4] io_uring: fix missing io_queue_linked_timeout() Pavel Begunkov
2020-07-25 11:42 ` [PATCH 3/4] io-wq: update hash bits Pavel Begunkov
2020-07-25 11:42 ` [PATCH 4/4] io_uring: fix racy req->flags modification Pavel Begunkov
2020-07-25 15:48 ` [PATCH 0/4] 5.9 fixes 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=95fc105c8a8cb7d04ae552ff8dd92e5d782e81b4.1595677308.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