[PATCH 0/6] nvme: fix transport request and queue error handling
shao.mingyin at zte.com.cn
shao.mingyin at zte.com.cn
Tue Nov 10 07:03:04 PST 2026
The six patches fix independent error paths in the NVMe transports.
Patch 1 releases the target request in nvme-loop when SG setup fails.
nvmet_req_init() has already taken the queue, namespace and reservation
references, and blk-mq retries the same request, so each failure leaked a
set of references.
Patch 2 makes the TCP target wait for in-capsule data only when the SGL
is really an offset data block descriptor. The old check looked only at
the descriptor length, so a transport SGL of the same length was treated
as in-capsule data; the same check is used when request initialization
fails.
Patch 3 requires the R2T offset to equal the number of bytes already
sent. A larger offset let the host advertise an offset past the data
that its next H2CData PDU carried.
Patch 4 frees the fcloop LS request when nvmet_fc_rcv_ls_req() fails
before taking ownership.
Patch 5 publishes an FC target queue only if its slot is still free. A
duplicate Create Connection replaced the old pointer and leaked the queue
and its controller reference.
Patch 6 rolls back the SQ binding and the controller reference taken by
nvmet_install_queue() when the CQ is already bound to another controller,
and destroys the CQ binding when the transport cannot install the queue.
The six patches are independent and can be applied in any order or as a
subset. All carry Fixes: and Cc: stable.
Shao Mingyin (6):
nvme-loop: release the target request when SG setup fails
nvmet-tcp: only wait for in-capsule data for inline SGLs
nvme-tcp: require the R2T offset to match the data sent
nvmet-fcloop: free the LS request when delivery fails
nvmet-fc: reject duplicate queue IDs on Create Connection
nvmet: roll back queue bindings on connection failure
drivers/nvme/host/tcp.c | 2 +-
drivers/nvme/target/fabrics-cmd.c | 3 +++
drivers/nvme/target/fc.c | 13 +++++++++++--
drivers/nvme/target/fcloop.c | 2 ++
drivers/nvme/target/loop.c | 1 +
drivers/nvme/target/tcp.c | 35 ++++++++++++++++++++++-------------
6 files changed, 40 insertions(+), 16 deletions(-)
---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
More information about the Linux-nvme
mailing list