Re: [PATCH 06/11] block: fix queue freeze vs limits lock order in sysfs store methods
- To: John Garry <john.g.garry@oracle.com>
- Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>, Damien Le Moal <dlemoal@kernel.org>, Ming Lei <ming.lei@redhat.com>, Nilay Shroff <nilay@linux.ibm.com>, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, nbd@other.debian.org, linux-scsi@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, Johannes Thumshirn <johannes.thumshirn@wdc.com>
- Subject: Re: [PATCH 06/11] block: fix queue freeze vs limits lock order in sysfs store methods
- From: Christoph Hellwig <hch@lst.de>
- Date: Fri, 10 Jan 2025 10:33:11 +0100
- Message-id: <[🔎] 20250110093311.GA9083@lst.de>
- In-reply-to: <[🔎] 8cfe7690-0101-42e7-ba97-6c6b717c4706@oracle.com>
- References: <[🔎] 20250109055810.1402918-1-hch@lst.de> <[🔎] 20250109055810.1402918-7-hch@lst.de> <[🔎] 8cfe7690-0101-42e7-ba97-6c6b717c4706@oracle.com>
On Thu, Jan 09, 2025 at 01:07:47PM +0000, John Garry wrote:
> Do you mean that the sysfs_lock could be removed in future? I would have
> thought that queue limits lock could be used for the same thing, but I am
> probably failing to see some lock nesting/ordering issues...
More or less. Think about it: what does it even try to protect?
Readіng/writing sysfs files vs itself and file removal it serialized by
sysfs/kernfs internally.
Any information tweaked in sysfs usually also has other places that can
modify it. So we'll need a lock independent of sysfs for that anyway.
A big part, buy by far all of that is covered by limits_lock.
Serializing creating/removing sysfs attribues is supposed to be
serialized using sysfs_dir_lock, although that needs a careful audit.
It's also used to serialize a few debugfs things, but we'll need to look
carefully for what exactly and switch that over to debugfs_mutex or
something new.
And then there's a bunch of misc cruft that also needs a careful look.
Reply to: