blk-throttle: improve bypassing bios checkings
[linux-block.git] / block / blk-throttle.c
index a062539d84d08765caecc5c2c37d0b38086455e6..78316955e30fe3aecc25e57192960cd7ae5d1d57 100644 (file)
@@ -421,11 +421,16 @@ static void tg_update_has_rules(struct throtl_grp *tg)
        struct throtl_data *td = tg->td;
        int rw;
 
-       for (rw = READ; rw <= WRITE; rw++)
-               tg->has_rules[rw] = (parent_tg && parent_tg->has_rules[rw]) ||
+       for (rw = READ; rw <= WRITE; rw++) {
+               tg->has_rules_iops[rw] =
+                       (parent_tg && parent_tg->has_rules_iops[rw]) ||
                        (td->limit_valid[td->limit_index] &&
-                        (tg_bps_limit(tg, rw) != U64_MAX ||
-                         tg_iops_limit(tg, rw) != UINT_MAX));
+                         tg_iops_limit(tg, rw) != UINT_MAX);
+               tg->has_rules_bps[rw] =
+                       (parent_tg && parent_tg->has_rules_bps[rw]) ||
+                       (td->limit_valid[td->limit_index] &&
+                        (tg_bps_limit(tg, rw) != U64_MAX));
+       }
 }
 
 static void throtl_pd_online(struct blkg_policy_data *pd)