From: Jens Axboe Date: Fri, 24 Feb 2023 16:59:44 +0000 (-0700) Subject: block: clear bio->bi_bdev when putting a bio back in the cache X-Git-Tag: v6.6.17~5370^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11eb695feb636fa5211067189cad25ac073e7fe5;p=platform%2Fkernel%2Flinux-rpi.git block: clear bio->bi_bdev when putting a bio back in the cache This isn't strictly needed in terms of correctness, but it does allow polling to know if the bio has been put already by a different task and hence avoid polling something that we don't need to. Cc: stable@vger.kernel.org Fixes: be4d234d7aeb ("bio: add allocation cache abstraction") Reviewed-by: Keith Busch Signed-off-by: Jens Axboe --- diff --git a/block/bio.c b/block/bio.c index 2693f34..605c400 100644 --- a/block/bio.c +++ b/block/bio.c @@ -772,6 +772,7 @@ static inline void bio_put_percpu_cache(struct bio *bio) if ((bio->bi_opf & REQ_POLLED) && !WARN_ON_ONCE(in_interrupt())) { bio->bi_next = cache->free_list; + bio->bi_bdev = NULL; cache->free_list = bio; cache->nr++; } else {