aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2022-02-04 08:19:34 +0100
committerJens Axboe <[email protected]>2022-02-04 06:32:43 -0700
commit78e3437450be5236c4949e377c9b848bbcd4fcb0 (patch)
tree9f7fb0e4b18dd1e6c02ed0b6737be2fe6b06f1ac
parent9574d43479e16352e75bc875c9952ed8e129c9b2 (diff)
block: call bio_associate_blkg from bio_reset
Call bio_associate_blkg just like bio_set_dev did in the callers before the conversion to set the block device in bio_reset. Fixes: a7c50c940477 ("block: pass a block_device and opf to bio_reset") Reported-by: [email protected] Tested-by: [email protected] Signed-off-by: Christoph Hellwig <[email protected]> Tested-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--block/bio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/bio.c b/block/bio.c
index 2e19ca600fcd..d2f3c1035036 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -310,6 +310,8 @@ void bio_reset(struct bio *bio, struct block_device *bdev, unsigned int opf)
memset(bio, 0, BIO_RESET_BYTES);
atomic_set(&bio->__bi_remaining, 1);
bio->bi_bdev = bdev;
+ if (bio->bi_bdev)
+ bio_associate_blkg(bio);
bio->bi_opf = opf;
}
EXPORT_SYMBOL(bio_reset);