Skip to contentSkip to conversation

percpu_counter: fix irq restore in __percpu_counter_add

PATCH In review Christoph Hellwig 2 participants 2 messages Oct 3, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 percpu_counter: fix irq restore in __percpu_counter_add

The current version of "percpu_counter: make APIs irq safe" in the blk-mq tree doesn't properly restore irqs, thus causing the boot of the blk-multique tree to fail with various irqs_disabled() BUGs and related issues.

lib/percpu_counter.c +1 -1
index 1ae43a7..7473ee3 100644
@@ -82,7 +82,7 @@ void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
 		unsigned long flags;
 		raw_spin_lock_irqsave(&fbc->lock, flags);
 		fbc->count += count;
-		raw_spin_unlock(&fbc->lock);
+		raw_spin_unlock_irqrestore(&fbc->lock, flags);
 		__this_cpu_write(*fbc->counters, 0);
 	} else {
 		__this_cpu_write(*fbc->counters, count);
#1 lore raw
Quoted 5 lines · Christoph Hellwig

The current version of "percpu_counter: make APIs irq safe" in the blk-mq tree doesn't properly restore irqs, thus causing the boot of the blk-multique tree to fail with various irqs_disabled() BUGs and related issues.

Thanks Christoph, merge issue I'm assuming. I'll fix it up.

Signature · 1 line
Jens Axboe