Re: [PATCH v3] nvme-tcp: fix connect failure on receiving partial ICResp PDU
From: Caleb Sander
Date: Fri Jan 24 2025 - 13:40:11 EST
Indeed. Time for v4...
On Fri, Jan 24, 2025 at 10:38 AM Keith Busch <kbusch@xxxxxxxxxx> wrote:
>
> On Fri, Jan 24, 2025 at 11:03:41AM -0700, Caleb Sander Mateos wrote:
> > + msg.msg_flags = MSG_WAITALL;
> > ret = kernel_recvmsg(queue->sock, &msg, &iov, 1,
> > iov.iov_len, msg.msg_flags);
> > - if (ret < 0) {
> > + if (ret < sizeof(*icresp)) {
> > pr_warn("queue %d: failed to receive icresp, error %d\n",
> > nvme_tcp_queue_id(queue), ret);
> > + ret = -ECONNRESET;
>
> If kernel_recvmsg() returns an error, don't we want to preserve and
> return that instead of unconditionally overriding to -ECONNRESET? I
> think the suggestion was to set ret to that only if ret >= 0.