|
@@ -2129,8 +2129,9 @@ static inline void throtl_update_latency_buckets(struct throtl_data *td)
|
|
static void blk_throtl_assoc_bio(struct throtl_grp *tg, struct bio *bio)
|
|
static void blk_throtl_assoc_bio(struct throtl_grp *tg, struct bio *bio)
|
|
{
|
|
{
|
|
#ifdef CONFIG_BLK_DEV_THROTTLING_LOW
|
|
#ifdef CONFIG_BLK_DEV_THROTTLING_LOW
|
|
- if (bio->bi_css)
|
|
|
|
- bio_associate_blkg(bio, tg_to_blkg(tg));
|
|
|
|
|
|
+ /* fallback to root_blkg if we fail to get a blkg ref */
|
|
|
|
+ if (bio->bi_css && (bio_associate_blkg(bio, tg_to_blkg(tg)) == -ENODEV))
|
|
|
|
+ bio_associate_blkg(bio, bio->bi_disk->queue->root_blkg);
|
|
bio_issue_init(&bio->bi_issue, bio_sectors(bio));
|
|
bio_issue_init(&bio->bi_issue, bio_sectors(bio));
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|