Re: [syzbot] [block?] [trace?] INFO: task hung in blk_trace_remove (2)
From: Edward Adam Davis
Date: Wed Jan 31 2024 - 07:00:14 EST
please test task hung in blk_trace_remove
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index d5d94510afd3..4543be718362 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -313,6 +313,7 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
{
+ mutex_unlock(&q->debugfs_mutex);
relay_close(bt->rchan);
/*
@@ -325,6 +326,7 @@ static void blk_trace_free(struct request_queue *q, struct blk_trace *bt)
} else {
debugfs_remove(bt->dir);
}
+ mutex_lock(&q->debugfs_mutex);
free_percpu(bt->sequence);
free_percpu(bt->msg_data);
kfree(bt);
--
2.43.0