• Sagi Grimberg's avatar
    nvme-tcp: fix H2CData PDU send accounting (again) · 25e1f67e
    Sagi Grimberg authored
    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
    825619b0 ("nvme-tcp: fix possible use-after-completion").
    
    Commit e371af03 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: e371af03 ("nvme-tcp: fix incorrect h2cdata pdu offset accounting")
    Reported-by: default avatarKeith Busch <kbusch@kernel.org>
    Cc: stable@vger.kernel.org # 5.10+
    Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
    Reviewed-by: default avatarKeith Busch <kbusch@kernel.org>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    25e1f67e
tcp.c 66.2 KB