Merge tag 'locking-urgent-2020-08-10' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / block / blk-iocost.c
index 8e940c27c27cfd7938f7cd8a26fed53c53e52393..413e0b5c8e6b08cb9e76af181b267bbed84e8ead 100644 (file)
@@ -1369,7 +1369,7 @@ static void ioc_timer_fn(struct timer_list *timer)
         * should have woken up in the last period and expire idle iocgs.
         */
        list_for_each_entry_safe(iocg, tiocg, &ioc->active_iocgs, active_list) {
-               if (!waitqueue_active(&iocg->waitq) && iocg->abs_vdebt &&
+               if (!waitqueue_active(&iocg->waitq) && !iocg->abs_vdebt &&
                    !iocg_is_idle(iocg))
                        continue;
 
@@ -2044,8 +2044,7 @@ static struct blkg_policy_data *ioc_pd_alloc(gfp_t gfp, struct request_queue *q,
        int levels = blkcg->css.cgroup->level + 1;
        struct ioc_gq *iocg;
 
-       iocg = kzalloc_node(sizeof(*iocg) + levels * sizeof(iocg->ancestors[0]),
-                           gfp, q->node);
+       iocg = kzalloc_node(struct_size(iocg, ancestors, levels), gfp, q->node);
        if (!iocg)
                return NULL;