From: "Grupi, Elad" <Elad.Grupi@dell.com>
To: Hou Pu <houpu.main@gmail.com>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
"sagi@grimberg.me" <sagi@grimberg.me>
Subject: RE: [PATCH v4] nvmet-tcp: fix a segmentation fault during io parsing error
Date: Wed, 31 Mar 2021 08:28:46 +0000 [thread overview]
Message-ID: <DM6PR19MB40115FE64DF309D2591B9879EF7C9@DM6PR19MB4011.namprd19.prod.outlook.com> (raw)
In-Reply-To: <20210331074856.46966-1-houpu.main@gmail.com>
Not sure I'm following.
Once req_init is failed, nvmet_tcp_handle_req_failure is called and changes the state to NVMET_TCP_RECV_DATA.
In state NVMET_TCP_RECV_DATA we should not queue the response before it is get off from the list.
Am I missing something here?
-----Original Message-----
From: Hou Pu <houpu.main@gmail.com>
Sent: Wednesday, 31 March 2021 10:49
To: Grupi, Elad
Cc: linux-nvme@lists.infradead.org; sagi@grimberg.me
Subject: Re: [PATCH v4] nvmet-tcp: fix a segmentation fault during io parsing error
[EXTERNAL EMAIL]
On Tue, 30 Mar 2021 20:24:07 +0300, Elad wrote:
> @@ -960,7 +981,7 @@ static int nvmet_tcp_done_recv_pdu(struct nvmet_tcp_queue *queue)
> le32_to_cpu(req->cmd->common.dptr.sgl.length));
>
> nvmet_tcp_handle_req_failure(queue, queue->cmd, req);
> - return -EAGAIN;
> + return 0;
> }
>
> ret = nvmet_tcp_map_data(queue->cmd);
Hi Elad
By returning 0, the response is queued twice before it is get off from the list. Even still returning -EAGAIN, the cmd still could be queued twice potentially.
I think we'd better not queue the failed cmd in first place.
Please see my following fix later.
Thanks,
Hou
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2021-03-31 8:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 17:24 [PATCH v4] nvmet-tcp: fix a segmentation fault during io parsing error elad.grupi
2021-03-31 7:48 ` Hou Pu
2021-03-31 8:28 ` Grupi, Elad [this message]
2021-03-31 9:07 ` Hou Pu
2021-03-31 13:06 ` Grupi, Elad
2021-03-31 9:13 ` [PATCH v5] " Hou Pu
2021-03-31 13:27 ` Grupi, Elad
2021-04-02 16:17 ` Christoph Hellwig
2021-04-05 19:01 ` Grupi, Elad
2021-04-05 19:03 ` Grupi, Elad
2021-04-06 3:28 ` Hou Pu
2021-04-09 17:52 ` Sagi Grimberg
2021-04-15 7:57 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM6PR19MB40115FE64DF309D2591B9879EF7C9@DM6PR19MB4011.namprd19.prod.outlook.com \
--to=elad.grupi@dell.com \
--cc=houpu.main@gmail.com \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).