summaryrefslogtreecommitdiffstats
path: root/io_uring/fdinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'io_uring/fdinfo.c')
-rw-r--r--io_uring/fdinfo.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
index fcedde4b4b1e..f941c73f5502 100644
--- a/io_uring/fdinfo.c
+++ b/io_uring/fdinfo.c
@@ -13,6 +13,7 @@
#include "io_uring.h"
#include "sqpoll.h"
#include "fdinfo.h"
+#include "cancel.h"
#ifdef CONFIG_PROC_FS
static __cold int io_uring_show_cred(struct seq_file *m, unsigned int id,
@@ -157,17 +158,19 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,
mutex_unlock(&ctx->uring_lock);
seq_puts(m, "PollList:\n");
- spin_lock(&ctx->completion_lock);
for (i = 0; i < (1U << ctx->cancel_hash_bits); i++) {
- struct hlist_head *list = &ctx->cancel_hash[i];
+ struct io_hash_bucket *hb = &ctx->cancel_hash[i];
struct io_kiocb *req;
- hlist_for_each_entry(req, list, hash_node)
+ spin_lock(&hb->lock);
+ hlist_for_each_entry(req, &hb->list, hash_node)
seq_printf(m, " op=%d, task_works=%d\n", req->opcode,
task_work_pending(req->task));
+ spin_unlock(&hb->lock);
}
seq_puts(m, "CqOverflowList:\n");
+ spin_lock(&ctx->completion_lock);
list_for_each_entry(ocqe, &ctx->cq_overflow_list, list) {
struct io_uring_cqe *cqe = &ocqe->cqe;