[Bug 215157] New: nvme delete-ns over nvme-tcp to nvmet-tcp error

Sagi Grimberg sagi at grimberg.me
Wed Dec 8 05:24:05 PST 2021


>>> [10814.174841] Workqueue: events nvmet_tcp_release_queue_work 
>>> [nvmet_tcp]
>>> [10814.174850] Call Trace:
>>> [10814.174852]  <TASK>
>>> [10814.174855]  __schedule+0x23f/0xe50
>>> [10814.174861]  ? update_load_avg+0x77/0x4d0
>>> [10814.174866]  schedule+0x50/0xd0
>>> [10814.174869]  schedule_timeout+0x99/0xd0
>>> [10814.174873]  ? raw_spin_rq_lock_nested+0x19/0x80
>>> [10814.174876]  wait_for_completion+0x74/0xc0
>>> [10814.174880]  __flush_work.isra.0+0x14b/0x210
>>> [10814.174884]  ? flush_workqueue_prep_pwqs+0x110/0x110
>>> [10814.174887]  nvmet_tcp_release_queue_work+0xc3/0x330 [nvmet_tcp]
>>> [10814.174892]  process_one_work+0x1ad/0x310
>>> [10814.174895]  worker_thread+0x48/0x3d0
>>> [10814.174899]  ? process_one_work+0x310/0x310
>>> [10814.174901]  kthread+0x155/0x180
>>> [10814.174904]  ? set_kthread_struct+0x30/0x30
>>> [10814.174907]  ret_from_fork+0x1f/0x30
>>> [10814.174912]  </TASK>
>>> [10830.558291] nvme nvme2: queue 0: timeout request 0x0 type 4
>>> [10830.558422] nvme nvme2: Connect command failed, error wo/DNR bit: 881
>>> [10830.558484] nvme nvme2: failed to connect queue: 0 ret=881
>>> [10830.558507] nvme nvme2: Failed reconnect attempt 2
>>> [10830.558510] nvme nvme2: Reconnecting in 10 seconds...
>>> [10904.284728] nvme nvme2: queue 0: timeout request 0x0 type 4
>>> [10904.284757] nvme nvme2: Connect command failed, error wo/DNR bit: 881
>>> [10904.284818] nvme nvme2: failed to connect queue: 0 ret=881
>>> [10904.284842] nvme nvme2: Failed reconnect attempt 3
>>> [10904.284845] nvme nvme2: Reconnecting in 10 seconds...
> 
> The issue here seems to be that the controller fails the command but it
> still times out for the host - which suggest that the error response is
> not actually queued.

This should resolve the issue:
--
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index cb6a473c3eaf..a91ae06abce0 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -922,7 +922,7 @@ static void nvmet_tcp_handle_req_failure(struct 
nvmet_tcp_queue *queue,
         size_t data_len = le32_to_cpu(req->cmd->common.dptr.sgl.length);
         int ret;

-       if (!nvme_is_write(cmd->req.cmd) ||
+       if (!nvme_is_write(cmd->req.cmd) || !data_len ||
             data_len > cmd->req.port->inline_data_size) {
                 nvmet_prepare_receive_pdu(queue);
                 return;
--



More information about the Linux-nvme mailing list