Skip to content

Commit

Permalink
io_uring: fix a layering violation in io_iopoll_req_issued
Browse files Browse the repository at this point in the history
syscall-level code can't just poke into the details of the poll cookie,
which is private information of the block layer.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211012111226.760968-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Oct 18, 2021
1 parent f79d474 commit 30da1b4
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2738,19 +2738,12 @@ static void io_iopoll_req_issued(struct io_kiocb *req)
ctx->poll_multi_queue = false;
} else if (!ctx->poll_multi_queue) {
struct io_kiocb *list_req;
unsigned int queue_num0, queue_num1;

list_req = list_first_entry(&ctx->iopoll_list, struct io_kiocb,
inflight_entry);

if (list_req->file != req->file) {
if (list_req->file != req->file)
ctx->poll_multi_queue = true;
} else {
queue_num0 = blk_qc_t_to_queue_num(list_req->rw.kiocb.ki_cookie);
queue_num1 = blk_qc_t_to_queue_num(req->rw.kiocb.ki_cookie);
if (queue_num0 != queue_num1)
ctx->poll_multi_queue = true;
}
}

/*
Expand Down

0 comments on commit 30da1b4

Please sign in to comment.