Skip to content
Commit 3d05f3ae authored by Julia Cartwright's avatar Julia Cartwright Committed by Shaohua Li
Browse files

md/raid5: make use of spin_lock_irq over local_irq_disable + spin_lock



On mainline, there is no functional difference, just less code, and
symmetric lock/unlock paths.

On PREEMPT_RT builds, this fixes the following warning, seen by
Alexander GQ Gerasiov, due to the sleeping nature of spinlocks.

   BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:993
   in_atomic(): 0, irqs_disabled(): 1, pid: 58, name: kworker/u12:1
   CPU: 5 PID: 58 Comm: kworker/u12:1 Tainted: G        W       4.9.20-rt16-stand6-686 #1
   Hardware name: Supermicro SYS-5027R-WRF/X9SRW-F, BIOS 3.2a 10/28/2015
   Workqueue: writeback wb_workfn (flush-253:0)
   Call Trace:
    dump_stack+0x47/0x68
    ? migrate_enable+0x4a/0xf0
    ___might_sleep+0x101/0x180
    rt_spin_lock+0x17/0x40
    add_stripe_bio+0x4e3/0x6c0 [raid456]
    ? preempt_count_add+0x42/0xb0
    raid5_make_request+0x737/0xdd0 [raid456]

Reported-by: default avatarAlexander GQ Gerasiov <gq@redlab-i.ru>
Tested-by: default avatarAlexander GQ Gerasiov <gq@redlab-i.ru>
Signed-off-by: default avatarJulia Cartwright <julia@ni.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent 4ac4d584
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment