Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] nvme: fix transport request and queue error handling
@ 2026-11-10 15:03 shao.mingyin
  2026-11-10 15:03 ` [PATCH 1/6] nvme-loop: release the target request when SG setup fails shao.mingyin
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: shao.mingyin @ 2026-11-10 15:03 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi, linux-nvme
  Cc: justin.tee, nareshgottumukkala83, paul.ely, kch, linux-kernel,
	stable

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-11-12 21:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-10 15:03 [PATCH 0/6] nvme: fix transport request and queue error handling shao.mingyin
2026-11-10 15:03 ` [PATCH 1/6] nvme-loop: release the target request when SG setup fails shao.mingyin
2026-11-12 21:10   ` Christoph Hellwig
2026-11-10 15:03 ` [PATCH 2/6] nvmet-tcp: only wait for in-capsule data for inline SGLs shao.mingyin
2026-11-12 21:12   ` Christoph Hellwig
2026-11-10 15:03 ` [PATCH 3/6] nvme-tcp: require the R2T offset to match the data sent shao.mingyin
2026-11-12 21:13   ` Christoph Hellwig
2026-11-10 15:03 ` [PATCH 4/6] nvmet-fcloop: free the LS request when delivery fails shao.mingyin
2026-11-12 21:13   ` Christoph Hellwig
2026-11-10 15:03 ` [PATCH 5/6] nvmet-fc: reject duplicate queue IDs on Create Connection shao.mingyin
2026-11-12 21:13   ` Christoph Hellwig
2026-11-10 15:03 ` [PATCH 6/6] nvmet: roll back queue bindings on connection failure shao.mingyin
2026-11-12 21:14   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox