Re: [PATCH] block: fix bd_size_lock use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 28, 2021 at 07:39:21AM -0700, Jens Axboe wrote:
> On 1/28/21 7:37 AM, Christoph Hellwig wrote:
> > On Thu, Jan 28, 2021 at 03:36:19PM +0900, Damien Le Moal wrote:
> >> 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.
> > 
> > I'd much rather fix the driver to not call set_capacity with irqs
> > disabled..
> 
> Agree, but that might be a bit beyond 5.10 at this point..

True.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux