diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-stat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-stat.c b/block/blk-stat.c index 74a1a8c32d86..bc7e0ed81642 100644 --- a/block/blk-stat.c +++ b/block/blk-stat.c @@ -190,7 +190,7 @@ void blk_stat_disable_accounting(struct request_queue *q) unsigned long flags; spin_lock_irqsave(&q->stats->lock, flags); - if (!--q->stats->accounting) + if (!--q->stats->accounting && list_empty(&q->stats->callbacks)) blk_queue_flag_clear(QUEUE_FLAG_STATS, q); spin_unlock_irqrestore(&q->stats->lock, flags); } @@ -201,7 +201,7 @@ void blk_stat_enable_accounting(struct request_queue *q) unsigned long flags; spin_lock_irqsave(&q->stats->lock, flags); - if (!q->stats->accounting++) + if (!q->stats->accounting++ && list_empty(&q->stats->callbacks)) blk_queue_flag_set(QUEUE_FLAG_STATS, q); spin_unlock_irqrestore(&q->stats->lock, flags); } |