public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH V2 0/2] nvmet-tcp: fix receive path error handling and state machine
@ 2026-03-12 13:40 Maurizio Lombardi
  2026-03-12 13:40 ` [PATCH V2 1/2] nvmet-tcp: propagate nvmet_tcp_build_pdu_iovec() errors to its callers Maurizio Lombardi
  2026-03-12 13:40 ` [PATCH V2 2/2] nvmet-tcp: remove redundant calls to nvmet_tcp_fatal_error() Maurizio Lombardi
  0 siblings, 2 replies; 10+ messages in thread
From: Maurizio Lombardi @ 2026-03-12 13:40 UTC (permalink / raw)
  To: kbusch; +Cc: linux-nvme, dwagner, yjshin0438, hare, sagi, chaitanyak, mlombard

Patch 1 fixes a potential issue where network data could be read into an
uninitialized iterator. Currently, nvmet_tcp_build_pdu_iovec() returns void,
meaning callers are unaware if an out-of-bounds PDU length or offset triggers
an early return. Consequently, callers blindly overwrite the queue state to
NVMET_TCP_RECV_DATA. This patch modifies the function to return an error code,
shifting the handling responsibility to the callers to ensure proper socket
teardown.

Patch 2 cleans up redundant, localized calls to nvmet_tcp_fatal_error() scattered
across the receive path. It delegates the responsibility of executing the fatal
error function to the top-level caller by bubbling up the error codes.

V2: some cosmetic changes to Patch 1, no functional changes.

Maurizio Lombardi (2):
  nvmet-tcp: propagate nvmet_tcp_build_pdu_iovec() errors to its callers
  nvmet-tcp: remove redundant calls to nvmet_tcp_fatal_error()

 drivers/nvme/target/tcp.c | 73 ++++++++++++++++++---------------------
 1 file changed, 34 insertions(+), 39 deletions(-)

-- 
2.53.0



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

end of thread, other threads:[~2026-03-13  8:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12 13:40 [PATCH V2 0/2] nvmet-tcp: fix receive path error handling and state machine Maurizio Lombardi
2026-03-12 13:40 ` [PATCH V2 1/2] nvmet-tcp: propagate nvmet_tcp_build_pdu_iovec() errors to its callers Maurizio Lombardi
2026-03-13  7:10   ` Hannes Reinecke
2026-03-13  7:45     ` Maurizio Lombardi
2026-03-13  8:11       ` Hannes Reinecke
2026-03-12 13:40 ` [PATCH V2 2/2] nvmet-tcp: remove redundant calls to nvmet_tcp_fatal_error() Maurizio Lombardi
2026-03-13  7:20   ` Hannes Reinecke
2026-03-13  7:51     ` Maurizio Lombardi
2026-03-13  8:11       ` Hannes Reinecke
2026-03-13  8:14         ` Maurizio Lombardi

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