Commit e02657ea authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe

blk-mq: handle already freed tags gracefully in blk_mq_free_rqs

To simplify further changes allow for double calling blk_mq_free_rqs on
a queue.
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
[hch: split out from a larger patch]
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20220308055200.735835-3-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 41fa7222
......@@ -3071,6 +3071,9 @@ void blk_mq_free_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags,
struct blk_mq_tags *drv_tags;
struct page *page;
if (list_empty(&tags->page_list))
return;
if (blk_mq_is_shared_tags(set->flags))
drv_tags = set->shared_tags;
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment