blk-mq-dma: always initialize dma state
PATCH v2 1/1 blk-mq-dma: always initialize dma state
From: Keith Busch <[email protected]>
Ensure the dma state is initialized when we're not using the contiguous iova, otherwise the caller may be using a stale state from a previous request that could use the coalesed iova allocation.
---v1->v2:
Simpler logic to always do the state initialization
block/blk-mq-dma.c | 1 + 1 file changed, 1 insertion(+)
block/blk-mq-dma.c +1 -0
@@ -199,6 +199,7 @@ static bool blk_dma_map_iter_start(struct request *req, struct device *dma_dev,if (blk_can_dma_map_iova (req, dma_dev) &&dma_iova_try_alloc (dma_dev, state, vec.paddr, total_len))return blk_rq_dma_map_iova (req, dma_dev, state, iter, &vec); +memset (state,0 ,sizeof (*state));return blk_dma_map_direct (req, dma_dev, iter, &vec); }
Signature · 1 line
2.47.3
Quoted 5 lines · Keith Busch
From: Keith Busch <[email protected]>
Ensure the dma state is initialized when we're not using the contiguous iova, otherwise the caller may be using a stale state from a previous request that could use the coalesed iova allocation.
Looks good:
Quoted 5 lines · Keith Busch
Ensure the dma state is initialized when we're not using the contiguous iova, otherwise the caller may be using a stale state from a previous request that could use the coalesed iova allocation.
Applied, thanks!
[1/1] blk-mq-dma: always initialize dma state
commit: a0750fae73c55112ea11a4867bee40f11e679405
Best regards,
Signature · 1 line
Jens Axboe