]> granicus.if.org Git - zfs/commit
Consistently use local_irq_disable/local_irq_enable
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 25 Sep 2013 21:52:29 +0000 (14:52 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 9 Oct 2013 21:00:56 +0000 (14:00 -0700)
commit429fe89ceefa033120f220787265eb10d77991e7
tree79f5a4ca63c57afbdf6711e0c7a5a1a6c498af84
parent6a696939617503e5c34dbb88ba62d556ce994bf1
Consistently use local_irq_disable/local_irq_enable

It was observed that spl_kmem_cache_alloc() uses local_irq_save()
and saves the interrupt state in a local variable.  This would
normally be fine except that spl_kmem_cache_alloc() calls
spl_cache_refill() which re-enables interrupts.  It is then
possible that while interrupts are enabled the process is
rescheduled to a different cpu before being disable again.
This could result in us restoring the saved interrupt state
from one cpu to another.

What the consequences of this are aren't perfectly clear, but
this is clearly a bug and it has the potential to cause issues.
The code has been updated to just use local_irq_enable() and
local_irq_disable() to avoid this.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
module/spl/spl-kmem.c