linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
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] nvme-tcp: fix a segmentation fault during io parsing error
Date: Tue, 16 Mar 2021 15:52:17 +0000	[thread overview]
Message-ID: <DM6PR19MB40116B3A8A9751C4BA926521EF6B9@DM6PR19MB4011.namprd19.prod.outlook.com> (raw)
In-Reply-To: <20210316093539.16125-1-houpu.main@gmail.com>

Hi Hou,

You are correct, this is the same issue.

I have reviewed your patch and I have two concerns:
1. As Sagi mentioned, you might not have all the inline data in the socket at this point.
2. You might get hit on the last round of the budget of the receive loop, so you will still have a chance of hitting the response flow before reading all the data from the socket.

Elad

-----Original Message-----
From: Hou Pu <houpu.main@gmail.com> 
Sent: Tuesday, 16 March 2021 11:36
To: Grupi, Elad
Cc: linux-nvme@lists.infradead.org; sagi@grimberg.me
Subject: RE: [PATCH] nvme-tcp: fix a segmentation fault during io parsing error


[EXTERNAL EMAIL] 

Hi Elad and Sagi,

I think this bug is the same one I am trying to fix. Sorry I did not notice Elad was trying to fix this in time.

Elad, could please take a look at this thread. I think these two bug are same.
The callback is same.

[PATCH] nvmet-tcp: finish receiving before send back response if nvmet_req_init() failed.
https://lore.kernel.org/linux-nvme/a4ae0e4b-3d59-3a5a-1533-4545e2e4633e@gmail.com/T/#t

>@@ -476,7 +477,11 @@ static struct nvmet_tcp_cmd *nvmet_tcp_fetch_cmd(struct nvmet_tcp_queue *queue)
>   	  nvmet_setup_c2h_data_pdu(queue->snd_cmd);
>-	else
>+	else if (nvmet_tcp_has_data_in(queue->snd_cmd) &&
>+			       +nvmet_tcp_has_inline_data(queue->snd_cmd)) {
>+		nvmet_tcp_queue_response(&queue->snd_cmd->req);
>+		queue->snd_cmd = NULL;
>+	} else

Here when we get a new cmd and find it has data remains to be read.
I think that in fact this request might already been replied by nvmet_req_init().
And the inline data should also be consumed by read it from the socket.


Thanks,
Hou

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2021-03-16 15:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 11:51 [PATCH] nvme-tcp: fix a segmentation fault during io parsing error elad.grupi
2021-01-13 22:47 ` Sagi Grimberg
2021-01-14 11:51   ` Grupi, Elad
2021-01-14 21:18     ` Sagi Grimberg
2021-01-14 21:41       ` Grupi, Elad
2021-01-16  1:19         ` Sagi Grimberg
2021-01-17  9:46           ` Grupi, Elad
2021-01-31 15:48             ` Grupi, Elad
2021-03-16  9:35             ` Hou Pu
2021-03-16 15:52               ` Grupi, Elad [this message]
2021-03-17  4:11                 ` Hou Pu
2021-03-18  8:31                   ` Grupi, Elad
2021-03-16  6:21 ` Sagi Grimberg
2021-03-16 15:45   ` Grupi, Elad
2021-03-18  8:31     ` Grupi, Elad
  -- strict thread matches above, loose matches on Subject: below --
2021-01-14 13:04 elad.grupi
2021-01-12 14:00 elad.grupi

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=DM6PR19MB40116B3A8A9751C4BA926521EF6B9@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).