RE: [PATCH] nvme-tcp: fix a segmentation fault during io parsing error
From: Grupi, Elad <hidden>
Date: 2021-03-16 15:52:48
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 <redacted> 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 (local)
quoted hunk ↗ jump to hunk
@@ -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