Commit 0513b9d7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents 1c9df907 4ae6dbd6
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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;