diff --git a/include/spdk_internal/nvme_tcp.h b/include/spdk_internal/nvme_tcp.h index e78e6bf8a..ad9160692 100644 --- a/include/spdk_internal/nvme_tcp.h +++ b/include/spdk_internal/nvme_tcp.h @@ -307,16 +307,16 @@ nvme_tcp_build_iovs(struct iovec *iov, int iovcnt, struct nvme_tcp_pdu *pdu, _nvme_tcp_sgl_append(sgl, pdu->data_digest, SPDK_NVME_TCP_DIGEST_LEN); } -end: - if (_mapped_length != NULL) { - *_mapped_length = sgl->total_size; - } - /* check the plen for the first time constructing iov */ if (!pdu->writev_offset) { assert(plen == pdu->hdr.common.plen); } +end: + if (_mapped_length != NULL) { + *_mapped_length = sgl->total_size; + } + return iovcnt - sgl->iovcnt; }