]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-tcp: fix H2CData PDU send accounting (again)
authorSagi Grimberg <sagi@grimberg.me>
Sun, 24 Oct 2021 07:43:31 +0000 (10:43 +0300)
committerChristoph Hellwig <hch@lst.de>
Tue, 26 Oct 2021 08:41:29 +0000 (10:41 +0200)
commita50d06f50e5df26fb28c9a7a08f9237d2cf63fec
treee9915a50d150e48c048315abbbd1530297856243
parent8a42e1491d578fe022acae85db0f0e286900c5ba
nvme-tcp: fix H2CData PDU send accounting (again)

We should not access request members after the last send, even to
determine if indeed it was the last data payload send. The reason is
that a completion could have arrived and trigger a new execution of the
request which overridden these members. This was fixed by commit
db63c928047b ("nvme-tcp: fix possible use-after-completion").

Commit 5c5c68bd9568 broke that assumption again to address cases where
multiple r2t pdus are sent per request. To fix it, we need to record the
request data_sent and data_len and after the payload network send we
reference these counters to determine weather we should advance the
request iterator.

Fixes: 5c5c68bd9568 ("nvme-tcp: fix incorrect h2cdata pdu offset accounting")
Reported-by: Keith Busch <kbusch@kernel.org>
Cc: stable@vger.kernel.org # 5.10+
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/host/tcp.c