Skip to content

Commit 11eb695

Browse files
committed
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: [email protected] Fixes: be4d234 ("bio: add allocation cache abstraction") Reviewed-by: Keith Busch <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 9f6ad5d commit 11eb695

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

block/bio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ static inline void bio_put_percpu_cache(struct bio *bio)
772772

773773
if ((bio->bi_opf & REQ_POLLED) && !WARN_ON_ONCE(in_interrupt())) {
774774
bio->bi_next = cache->free_list;
775+
bio->bi_bdev = NULL;
775776
cache->free_list = bio;
776777
cache->nr++;
777778
} else {

0 commit comments

Comments
 (0)