Skip to content

nvmet-tcp: fix receive path error handling and state machine

Maurizio Lombardi linux-nvme 3 versions – Applied

Status from this message: Thanks, applied to nvme-7.1.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 6 repliesApplied
  2. v22 patches 7 repliesSuperseded
  3. v12 patches 5 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2nvmet-tcp: propagate nvmet_tcp_build_pdu_iovec() errors to its callersdrivers/nvme/target/tcp.c+29 -221 reply
2/2nvmet-tcp: remove redundant calls to nvmet_tcp_fatal_error()drivers/nvme/target/tcp.c+7 -301 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchHannes ReineckeYunje ShinChaitanya Kulkarni
SeriesR-b
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH V3 0/2] nvmet-tcp: fix receive path error handling and state machine

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.

V3: remove nvmet_tcp_fatal_error(), fold it into nvmet_tcp_socket_error()

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 | 88 ++++++++++++++++-----------------------
 1 file changed, 36 insertions(+), 52 deletions(-)
Signature · 1 line
2.53.0