public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] nvmet-tcp: handle ICReq PDU received in NVMET_TCP_Q_LIVE state
@ 2022-09-04 21:35 Varun Prakash
  2022-09-07 16:03 ` Chaitanya Kulkarni
  0 siblings, 1 reply; 3+ messages in thread
From: Varun Prakash @ 2022-09-04 21:35 UTC (permalink / raw)
  To: sagi, hch; +Cc: linux-nvme, varun

If target receives ICReq PDU in queue state NVMET_TCP_Q_LIVE
then call nvmet_tcp_fatal_error() and return -EPROTO.

Signed-off-by: Varun Prakash <varun@chelsio.com>
---
 drivers/nvme/target/tcp.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index a3694a32f6d5..02df2fc7dfe7 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -976,6 +976,13 @@ static int nvmet_tcp_done_recv_pdu(struct nvmet_tcp_queue *queue)
 		return nvmet_tcp_handle_icreq(queue);
 	}
 
+	if (unlikely(hdr->type == nvme_tcp_icreq)) {
+		pr_err("queue %d: received icreq pdu in state %d\n",
+			queue->idx, queue->state);
+		nvmet_tcp_fatal_error(queue);
+		return -EPROTO;
+	}
+
 	if (hdr->type == nvme_tcp_h2c_data) {
 		ret = nvmet_tcp_handle_h2c_data_pdu(queue);
 		if (unlikely(ret))
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] nvmet-tcp: handle ICReq PDU received in NVMET_TCP_Q_LIVE state
  2022-09-04 21:35 [PATCH] nvmet-tcp: handle ICReq PDU received in NVMET_TCP_Q_LIVE state Varun Prakash
@ 2022-09-07 16:03 ` Chaitanya Kulkarni
  2022-09-12 12:24   ` Sagi Grimberg
  0 siblings, 1 reply; 3+ messages in thread
From: Chaitanya Kulkarni @ 2022-09-07 16:03 UTC (permalink / raw)
  To: Varun Prakash
  Cc: linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me

On 9/4/22 14:35, Varun Prakash wrote:
> If target receives ICReq PDU in queue state NVMET_TCP_Q_LIVE
> then call nvmet_tcp_fatal_error() and return -EPROTO.
> 

Can you please state the detailed scenario in the commit log ?

-ck


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nvmet-tcp: handle ICReq PDU received in NVMET_TCP_Q_LIVE state
  2022-09-07 16:03 ` Chaitanya Kulkarni
@ 2022-09-12 12:24   ` Sagi Grimberg
  0 siblings, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2022-09-12 12:24 UTC (permalink / raw)
  To: Chaitanya Kulkarni, Varun Prakash
  Cc: linux-nvme@lists.infradead.org, hch@lst.de



On 9/7/22 19:03, Chaitanya Kulkarni wrote:
> On 9/4/22 14:35, Varun Prakash wrote:
>> If target receives ICReq PDU in queue state NVMET_TCP_Q_LIVE
>> then call nvmet_tcp_fatal_error() and return -EPROTO.
>>
> 
> Can you please state the detailed scenario in the commit log ?

Can't find the original patch... Where was this sent?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-12 12:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-04 21:35 [PATCH] nvmet-tcp: handle ICReq PDU received in NVMET_TCP_Q_LIVE state Varun Prakash
2022-09-07 16:03 ` Chaitanya Kulkarni
2022-09-12 12:24   ` Sagi Grimberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox