[bug report] WARNING: CPU: 3 PID: 522 at block/genhd.c:144 bdev_count_inflight_rw+0x26e/0x410
Yu Kuai
yukuai1 at huaweicloud.com
Thu Jun 26 01:25:41 PDT 2025
Hi, Christoph
在 2025/06/26 12:41, Yi Zhang 写道:
> [ 1022.225513] ---[ end trace 0000000000000000 ]---
> [ 1022.263295] CPU: 12 UID: 0 PID: 466 Comm: kworker/12:1H Tainted: G
> W 6.16.0-rc3.yu+ #2 PREEMPT(voluntary)
> [ 1022.291560] nvme nvme0: NVME-FC{0}: controller connect complete
> [ 1022.356344] Tainted: [W]=WARN
> [ 1022.356348] Hardware name: Dell Inc. PowerEdge R640/08HT8T, BIOS
> 2.22.2 09/12/2024
> [ 1022.356352] Workqueue: kblockd blk_mq_run_work_fn
> [ 1022.744652] RIP: 0010:bdev_end_io_acct+0x494/0x5c0
> [ 1022.749466] Code: 22 fd ff ff 48 c7 44 24 08 10 00 00 00 41 be 30
> 00 00 00 48 c7 04 24 50 00 00 00 e9 c3 fb ff ff 0f 1f 44 00 00 e9 f5
> fd ff ff <0f> 0b 48 83 c4 28 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc
> cc 48
> [ 1022.768235] RSP: 0018:ffffc9000f9f78e8 EFLAGS: 00010297
> [ 1022.773484] RAX: 00000000ffffffff RBX: ffff88a922776e64 RCX: ffffffffb003853f
> [ 1022.780632] RDX: ffffed15244eedcd RSI: 0000000000000004 RDI: ffff88a922776e64
> [ 1022.787784] RBP: ffffe8d448a4e440 R08: 0000000000000001 R09: ffffed15244eedcc
> [ 1022.794934] R10: ffff88a922776e67 R11: 0000000000000000 R12: ffff88a922776e68
> [ 1022.802101] R13: 0000000000000001 R14: 0000000000000028 R15: 0000000000007e42
> [ 1022.809251] FS: 0000000000000000(0000) GS:ffff889c3c5a7000(0000)
> knlGS:0000000000000000
> [ 1022.817352] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 1022.823114] CR2: 0000562e119bd048 CR3: 0000003661478001 CR4: 00000000007726f0
> [ 1022.830265] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [ 1022.837418] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [ 1022.844561] PKRU: 55555554
> [ 1022.847293] Call Trace:
> [ 1022.849762] <TASK>
> [ 1022.851898] nvme_end_req+0x4d/0x70 [nvme_core]
> [ 1022.856494] nvme_failover_req+0x3bd/0x530 [nvme_core]
> [ 1022.861692] nvme_fail_nonready_command+0x12c/0x170 [nvme_core]
> [ 1022.867666] nvme_fc_queue_rq+0x463/0x720 [nvme_fc]
Just a quick look, look like this stack has a problem that the request
nevert started, however it still goes to the bdev_end_io_acct().
nvme_fc_queue_rq
if (...)
// nvme_start_request never called.
return nvme_fail_nonready_command
I'm not that familiar with nvme-fc, does the following fix make sense to
you?
Thanks,
Kuai
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 014b387f1e8b..4b8f08be24a7 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2765,8 +2765,10 @@ nvme_fc_queue_rq(struct blk_mq_hw_ctx *hctx,
blk_status_t ret;
if (ctrl->rport->remoteport.port_state != FC_OBJSTATE_ONLINE ||
- !nvme_check_ready(&queue->ctrl->ctrl, rq, queue_ready))
+ !nvme_check_ready(&queue->ctrl->ctrl, rq, queue_ready)) {
+ nvme_clear_nvme_request(rq);
return nvme_fail_nonready_command(&queue->ctrl->ctrl, rq);
+ }
ret = nvme_setup_cmd(ns, rq);
if (ret)
More information about the Linux-nvme
mailing list