Skip to contentSkip to conversation

block: call bio_associate_blkg from bio_reset

PATCH Applied Christoph Hellwig 3 participants 3 messages Feb 4, 2022 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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]
---
 block/bio.c | 2 ++
 1 file changed, 2 insertions(+)
block/bio.c +2 -0
index 2e19ca600fcdb..d2f3c10350364 100644
@@ -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);
Signature · 1 line
2.30.2
Tested-by Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Christoph Hellwig

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]

---

This fixes the issue mentioned by Jens on the report, not sure if I can add reviewed-by after tested by tag, if not, please drop reviewed-by tag..

-ck

maintainer Applied
#2 lore raw
In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

Call bio_associate_blkg just like bio_set_dev did in the callers before the conversion to set the block device in bio_reset.

Applied, thanks!

[1/1] block: call bio_associate_blkg from bio_reset

      commit: 78e3437450be5236c4949e377c9b848bbcd4fcb0

Best regards,

Signature · 1 line
Jens Axboe