aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds2020-07-30 09:47:07 -0700
committerLinus Torvalds2020-07-30 09:47:07 -0700
commit0513b9d75c07cbcdfda3778b636d3d131d679eb1 (patch)
tree4f7df6b3f4d68047e0b22b5cffc31a4efea7917e
parent1c9df907da83812e4f33b59d3d142c864d9da57f (diff)
parent4ae6dbd683860b9edc254ea8acf5e04b5ae242e5 (diff)
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
-rw-r--r--fs/io_uring.c7
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;