Commit 906a8c3f authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

io_uring: fix punting req w/o grabbed env



It's not enough to check for REQ_F_WORK_INITIALIZED and punt async
assuming that io_req_work_grab_env() was called, it may not have been.
E.g. io_close_prep() and personality path set the flag without further
async init.

As a quick fix, always pass next work through io_req_task_queue().

Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 8ef77766
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -1766,13 +1766,9 @@ static void io_free_req(struct io_kiocb *req)
	io_req_find_next(req, &nxt);
	__io_free_req(req);

	if (nxt) {
		if (nxt->flags & REQ_F_WORK_INITIALIZED)
			io_queue_async_work(nxt);
		else
	if (nxt)
		io_req_task_queue(nxt);
}
}

/*
 * Drop reference to request, return next in chain (if there is one) if this