Re: [PATCHv2 1/6] blk-sysfs: remove q->sysfs_lock for attributes which don't need it

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

 




On 2/24/25 8:19 PM, Christoph Hellwig wrote:
> On Sat, Feb 22, 2025 at 08:44:51PM +0800, Ming Lei wrote:
>> IMO, it is fine to read it lockless without READ_ONCE/WRITE_ONCE because
>> disk->nr_zones is defined as 'unsigned int', which won't return garbage
>> value anytime.
>>
>> But I don't object if you want to change to READ_ONCE/WRITE_ONCE.
> 
> It changes every time the disk capacity changes.  And on the (uncommon)
> reformats.  So the best locking would be the same as for the disk
> capacity.
> 
So does that mean we shall use bdev->bd_size_lock or disk->open_mutex here?

Thanks,
--Nilay




[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