Skip to content
Commit ed0691cf authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Christoph Hellwig
Browse files

nvmet-tcp: fix regression in data_digest calculation



Data digest calculation iterates over command mapped iovec. However
since commit bac04454 we unmap the iovec before we handle the data
digest, and since commit 69b85e1f we clear nr_mapped when we unmap
the iov.

Instead of open-coding the command iov traversal, simply call
crypto_ahash_digest with the command sg that is already allocated (we
already do that for the send path). Rename nvmet_tcp_send_ddgst to
nvmet_tcp_calc_ddgst and call it from send and recv paths.

Fixes: 69b85e1f ("nvmet-tcp: add an helper to free the cmd buffers")
Fixes: bac04454 ("nvmet-tcp: fix kmap leak when data digest in use")
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent fbb564a5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment