Skip to content

Commit a0750fa

Browse files
keithbuschaxboe
authored andcommitted
blk-mq-dma: always initialize dma state
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. Fixes: 2f6b256 ("block: accumulate memory segment gaps per bio") Reported-by: Sebastian Ott <sebott@redhat.com> Tested-by: Sebastian Ott <sebott@redhat.com> Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent f22ecf9 commit a0750fa

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

block/blk-mq-dma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ static bool blk_dma_map_iter_start(struct request *req, struct device *dma_dev,
199199
if (blk_can_dma_map_iova(req, dma_dev) &&
200200
dma_iova_try_alloc(dma_dev, state, vec.paddr, total_len))
201201
return blk_rq_dma_map_iova(req, dma_dev, state, iter, &vec);
202+
memset(state, 0, sizeof(*state));
202203
return blk_dma_map_direct(req, dma_dev, iter, &vec);
203204
}
204205

0 commit comments

Comments
 (0)