[PATCH v1 0/1] nvmet-tcp: complete command on H2C protocol errors

Xixin Liu liuxixin at kylinos.cn
Tue Jun 2 18:14:17 PDT 2026


Hi,

This series fixes the H2C Data PDU error path in nvmet-tcp.

When nvmet_tcp_handle_h2c_data_pdu() hits err_proto it used to return
-EPROTO without completing the associated command (there is even a
FIXME in that path).  The host often only sees the connection drop.
Complete commands that already have a valid transfer tag with
nvmet_req_complete() before returning -EPROTO.  Skip completion when
req->sq is unset (pre-connect placeholder).

Tested: make M=drivers/nvme/target on linux-next; nvmet TCP target
with null-blk backend; nvme connect -t tcp loopback read smoke test;
malformed H2C Data PDU before Fabrics Connect and on an active Write
without kernel oops.

Thanks,
Xixin Liu

---

Xixin Liu (1):
  nvmet-tcp: complete command on H2C protocol errors

 drivers/nvme/target/tcp.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

-- 
2.43.0




More information about the Linux-nvme mailing list