Commit ed0691c
nvmet-tcp: fix regression in data_digest calculation
Data digest calculation iterates over command mapped iovec. However
since commit bac0445 we unmap the iovec before we handle the data
digest, and since commit 69b85e1 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: 69b85e1 ("nvmet-tcp: add an helper to free the cmd buffers")
Fixes: bac0445 ("nvmet-tcp: fix kmap leak when data digest in use")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>1 parent fbb564a commit ed0691c
1 file changed
Lines changed: 3 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
| 408 | + | |
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | 416 | | |
434 | 417 | | |
435 | 418 | | |
| |||
454 | 437 | | |
455 | 438 | | |
456 | 439 | | |
457 | | - | |
| 440 | + | |
458 | 441 | | |
459 | 442 | | |
460 | 443 | | |
| |||
1137 | 1120 | | |
1138 | 1121 | | |
1139 | 1122 | | |
1140 | | - | |
| 1123 | + | |
1141 | 1124 | | |
1142 | 1125 | | |
1143 | 1126 | | |
| |||
0 commit comments