Commit 30da1b45 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

io_uring: fix a layering violation in io_iopoll_req_issued

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: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211012111226.760968-5-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f79d4749
...@@ -2738,19 +2738,12 @@ static void io_iopoll_req_issued(struct io_kiocb *req) ...@@ -2738,19 +2738,12 @@ static void io_iopoll_req_issued(struct io_kiocb *req)
ctx->poll_multi_queue = false; ctx->poll_multi_queue = false;
} else if (!ctx->poll_multi_queue) { } else if (!ctx->poll_multi_queue) {
struct io_kiocb *list_req; struct io_kiocb *list_req;
unsigned int queue_num0, queue_num1;
list_req = list_first_entry(&ctx->iopoll_list, struct io_kiocb, list_req = list_first_entry(&ctx->iopoll_list, struct io_kiocb,
inflight_entry); inflight_entry);
if (list_req->file != req->file) { if (list_req->file != req->file)
ctx->poll_multi_queue = true; 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;
}
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment