diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2020-07-25 13:41:58 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-07-25 17:47:44 +0200 |
commit | b65e0dd6a2de050d3fc4c0db4969a245f4e7273e (patch) | |
tree | a5fda8de5085ef9c4750e852279d28ca43d141ba /fs/io_uring.c | |
parent | io_uring: deduplicate io_grab_files() calls (diff) | |
download | linux-b65e0dd6a2de050d3fc4c0db4969a245f4e7273e.tar.xz linux-b65e0dd6a2de050d3fc4c0db4969a245f4e7273e.zip |
io_uring: mark ->work uninitialised after cleanup
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 <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |