block: make sure local irq is disabled when calling __blkcg_rstat_flush
[sfrench/cifs-2.6.git] / block / blk-cgroup.c
index f0b5c9c41cdee1c40cab795beca2e5e932ef0d00..dce1548a7a0c3e3160c3660189e01399bab402e5 100644 (file)
@@ -970,6 +970,7 @@ static void __blkcg_rstat_flush(struct blkcg *blkcg, int cpu)
        struct llist_head *lhead = per_cpu_ptr(blkcg->lhead, cpu);
        struct llist_node *lnode;
        struct blkg_iostat_set *bisc, *next_bisc;
+       unsigned long flags;
 
        rcu_read_lock();
 
@@ -983,7 +984,7 @@ static void __blkcg_rstat_flush(struct blkcg *blkcg, int cpu)
         * When flushing from cgroup, cgroup_rstat_lock is always held, so
         * this lock won't cause contention most of time.
         */
-       raw_spin_lock(&blkg_stat_lock);
+       raw_spin_lock_irqsave(&blkg_stat_lock, flags);
 
        /*
         * Iterate only the iostat_cpu's queued in the lockless list.
@@ -1009,7 +1010,7 @@ static void __blkcg_rstat_flush(struct blkcg *blkcg, int cpu)
                        blkcg_iostat_update(parent, &blkg->iostat.cur,
                                            &blkg->iostat.last);
        }
-       raw_spin_unlock(&blkg_stat_lock);
+       raw_spin_unlock_irqrestore(&blkg_stat_lock, flags);
 out:
        rcu_read_unlock();
 }