在 2024/5/24 17:45, Li Nan 写道:
在 2024/5/24 11:49, Changhui Zhong 写道:
Hello,
I hit the kernel panic when running test ubdsrv generic/005,
please help check it and let me know if you need any info/testing for
it, thanks.
Can you test the following patch? WARN will still be triggered, but the
NULL pointer dereference will be fixed.
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index 4e159948c912..99b621b2d40f 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -2630,7 +2630,8 @@ static void ublk_queue_reinit(struct ublk_device *ub,
struct ublk_queue *ubq)
{
int i;
- WARN_ON_ONCE(!(ubq->ubq_daemon && ubq_daemon_is_dying(ubq)));
+ if (WARN_ON_ONCE(!(ubq->ubq_daemon && ubq_daemon_is_dying(ubq))))
+ return;
/* All old ioucmds have to be completed */
ubq->nr_io_ready = 0;
--
Thanks,
Nan