diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 30dda16bb879127f73104547c41e571cd8d6bf4d..09195fdd29430a71c608519bba8f33df29c86a04 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -1391,8 +1391,11 @@ static void iocg_pay_debt(struct ioc_gq *iocg, u64 abs_vpay, lockdep_assert_held(&iocg->ioc->lock); lockdep_assert_held(&iocg->waitq.lock); - /* make sure that nobody messed with @iocg */ - WARN_ON_ONCE(list_empty(&iocg->active_list)); + /* + * make sure that nobody messed with @iocg. Check iocg->online + * to avoid warn when removing blkcg or disk. + */ + WARN_ON_ONCE(list_empty(&iocg->active_list) && iocg->online); WARN_ON_ONCE(iocg->inuse > 1); iocg->abs_vdebt -= min(abs_vpay, iocg->abs_vdebt);