]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet-tcp: handle ICReq PDU received in NVMET_TCP_Q_LIVE state
authorVarun Prakash <varun@chelsio.com>
Tue, 20 Sep 2022 18:34:44 +0000 (00:04 +0530)
committerChristoph Hellwig <hch@lst.de>
Tue, 27 Sep 2022 07:22:08 +0000 (09:22 +0200)
commit139708b8006af1be39c4784f90f321a5fdd9edac
tree0ac6ca449fa3b1ae904cb3bfb82086bf6261ca0e
parent5e40cf728080cadaf9d447eb40e874f9e6ecb864
nvmet-tcp: handle ICReq PDU received in NVMET_TCP_Q_LIVE state

As per NVMe/TCP transport specification ICReq PDU is the first PDU received
by the controller and controller should receive only one ICReq PDU.

If controller receives more than one ICReq PDU then this can be considered
as fatal error.

nvmet-tcp driver does not check for ICReq PDU opcode if queue state is
NVMET_TCP_Q_LIVE. In LIVE state ICReq PDU is treated as CapsuleCmd PDU,
this can result in abnormal behavior.

Add a check for ICReq PDU in nvmet_tcp_done_recv_pdu() to fix this issue.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/tcp.c