[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_6D33089EBD1B9C4BEE1B2425C6BAB4BB9F08@qq.com>
Date: Wed, 31 Jan 2024 21:28:04 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+2373f6be3e6de4f92562@...kaller.appspotmail.com
Cc: akpm@...ux-foundation.org,
axboe@...nel.dk,
dvyukov@...gle.com,
linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org,
mathieu.desnoyers@...icios.com,
mhiramat@...nel.org,
pengfei.xu@...el.com,
rostedt@...dmis.org,
syzkaller-bugs@...glegroups.com
Subject: [PATCH] trace/blktrace: fix task hung in blk_trace_remove
Delete critical sections that are time-consuming and protected by other mutexes
to avoid this issue.
Reported-and-tested-by: syzbot+2373f6be3e6de4f92562@...kaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@...com>
---
kernel/trace/blktrace.c | 2 ++
1 file changed, 2 insertions(+)
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
Powered by blists - more mailing lists