diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-07-30 18:47:07 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-07-30 18:47:07 +0200 |
commit | 0513b9d75c07cbcdfda3778b636d3d131d679eb1 (patch) | |
tree | 4f7df6b3f4d68047e0b22b5cffc31a4efea7917e /fs | |
parent | random: fix circular include dependency on arm64 after addition of percpu.h (diff) | |
parent | io_uring: fix lockup in io_fail_links() (diff) | |
download | linux-0513b9d75c07cbcdfda3778b636d3d131d679eb1.tar.xz linux-0513b9d75c07cbcdfda3778b636d3d131d679eb1.zip |
Merge tag 'io_uring-5.8-2020-07-30' of git://git.kernel.dk/linux-block
Pull io_uring fixes from Jens Axboe:
"Two small fixes for corner/error cases"
* tag 'io_uring-5.8-2020-07-30' of git://git.kernel.dk/linux-block:
io_uring: fix lockup in io_fail_links()
io_uring: fix ->work corruption with poll_add
Diffstat (limited to 'fs')
-rw-r--r-- | fs/io_uring.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 32b0064f806e..493e5047e67c 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4199,10 +4199,9 @@ static void io_poll_task_handler(struct io_kiocb *req, struct io_kiocb **nxt) hash_del(&req->hash_node); io_poll_complete(req, req->result, 0); - req->flags |= REQ_F_COMP_LOCKED; - io_put_req_find_next(req, nxt); spin_unlock_irq(&ctx->completion_lock); + io_put_req_find_next(req, nxt); io_cqring_ev_posted(ctx); } @@ -4658,6 +4657,10 @@ static int io_poll_add(struct io_kiocb *req) struct io_poll_table ipt; __poll_t mask; + /* ->work is in union with hash_node and others */ + io_req_work_drop_env(req); + req->flags &= ~REQ_F_WORK_INITIALIZED; + INIT_HLIST_NODE(&req->hash_node); INIT_LIST_HEAD(&req->list); ipt.pt._qproc = io_poll_queue_proc; |