• Damien Le Moal's avatar
    block: fix bd_size_lock use · 0fe37724
    Damien Le Moal authored
    Some block device drivers, e.g. the skd driver, call set_capacity() with
    IRQ disabled. This results in lockdep ito complain about inconsistent
    lock states ("inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage")
    because set_capacity takes a block device bd_size_lock using the
    functions spin_lock() and spin_unlock(). Ensure a consistent locking
    state by replacing these calls with spin_lock_irqsave() and
    spin_lock_irqrestore(). The same applies to bdev_set_nr_sectors().
    With this fix, all lockdep complaints are resolved.
    Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    0fe37724
core.c 16.8 KB