]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet-tcp: fix possible list corruption for unexpected command failure
authorSagi Grimberg <sagi@grimberg.me>
Wed, 8 Dec 2021 13:35:06 +0000 (15:35 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 8 Dec 2021 15:36:58 +0000 (16:36 +0100)
commit0865047f99c133e906d0a038c341592663bdb8c0
tree9a1482fcff0fe270246b69859ac3ad601c38e16d
parentd9d40c05d3b2be92f54c655b3f7bbd4b34402c46
nvmet-tcp: fix possible list corruption for unexpected command failure

nvmet_tcp_handle_req_failure needs to understand weather to prepare
for incoming data or the next pdu. However if we misidentify this, we
will wait for 0-length data, and queue the response although nvmet_req_init
already did that.

The particular command was namespace management command with no data,
which was incorrectly categorized as a command with incapsule data.

Also, add a code comment of what we are trying to do here.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/tcp.c