Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xprtrdma: Fix DMA scatter-gather list mapping imbalance
The @nents value that was passed to ib_dma_map_sg() has to be passed to the matching ib_dma_unmap_sg() call. If ib_dma_map_sg() choses to concatenate sg entries, it will return a different nents value than it was passed. The bug was exposed by recent changes to the AMD IOMMU driver, which enabled sg entry concatenation. Looking all the way back to commit 4143f34 ("xprtrdma: Port to new memory registration API") and reviewing other kernel ULPs, it's not clear that the frwr_map() logic was ever correct for this case. Reported-by: Andre Tomt <[email protected]> Suggested-by: Robin Murphy <[email protected]> Signed-off-by: Chuck Lever <[email protected]> Cc: [email protected] Reviewed-by: Jason Gunthorpe <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
- Loading branch information