Skip to content

Commit 0513b9d

Browse files
committed
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
2 parents 1c9df90 + 4ae6dbd commit 0513b9d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/io_uring.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4199,10 +4199,9 @@ static void io_poll_task_handler(struct io_kiocb *req, struct io_kiocb **nxt)
41994199

42004200
hash_del(&req->hash_node);
42014201
io_poll_complete(req, req->result, 0);
4202-
req->flags |= REQ_F_COMP_LOCKED;
4203-
io_put_req_find_next(req, nxt);
42044202
spin_unlock_irq(&ctx->completion_lock);
42054203

4204+
io_put_req_find_next(req, nxt);
42064205
io_cqring_ev_posted(ctx);
42074206
}
42084207

@@ -4658,6 +4657,10 @@ static int io_poll_add(struct io_kiocb *req)
46584657
struct io_poll_table ipt;
46594658
__poll_t mask;
46604659

4660+
/* ->work is in union with hash_node and others */
4661+
io_req_work_drop_env(req);
4662+
req->flags &= ~REQ_F_WORK_INITIALIZED;
4663+
46614664
INIT_HLIST_NODE(&req->hash_node);
46624665
INIT_LIST_HEAD(&req->list);
46634666
ipt.pt._qproc = io_poll_queue_proc;

0 commit comments

Comments
 (0)