block: warn if throttle group is null
PATCH 1/1 block: warn if throttle group is null
If BLK_DEV_THROTTLING is enabled, bio->bi_blkg shouldn't be NULL, so warn if it is found as NULL, then return false and bypass throttling.
It helps Mike to figure out one dm-raid problem.
Cc Mike Snitzer <[email protected]>
Signed-off-by Ming Lei <[email protected]>
--- block/blk-throttle.h | 3 +++ 1 file changed, 3 insertions(+)
block/blk-throttle.h +3 -0
@@ -174,6 +174,9 @@ static inline bool blk_throtl_bio(struct bio *bio) {struct throtl_grp *tg =blkg_to_tg (bio->bi_blkg); +if (WARN_ON_ONCE (!tg)) +return false; +/* no need to throttle bps any more if the bio has been throttled */ if (bio_flagged (bio,BIO_THROTTLED ) && !(tg->flags &THROTL_TG_HAS_IOPS_LIMIT ))
Signature · 1 line
2.31.1