summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-02-24 17:59:44 +0100
committerJens Axboe <axboe@kernel.dk>2023-02-24 21:19:56 +0100
commit11eb695feb636fa5211067189cad25ac073e7fe5 (patch)
tree012349714053961ee1949a16487b67951f93f7f7 /block
parentloop: loop_set_status_from_info() check before assignment (diff)
downloadlinux-11eb695feb636fa5211067189cad25ac073e7fe5.tar.xz
linux-11eb695feb636fa5211067189cad25ac073e7fe5.zip
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 <kbusch@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/bio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/bio.c b/block/bio.c
index 2693f34afb7e..605c40025068 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 {