From: Christoph Hellwig <hch@lst.de>
To: Nilay Shroff <nilay@linux.ibm.com>
Cc: linux-block@vger.kernel.org, hch@lst.de, ming.lei@redhat.com,
dlemoal@kernel.org, axboe@kernel.dk, gjoyce@ibm.com
Subject: Re: [PATCH 2/2] block: avoid acquiring q->sysfs_lock while accessing sysfs attributes
Date: Wed, 5 Feb 2025 16:53:30 +0100 [thread overview]
Message-ID: <20250205155330.GA14133@lst.de> (raw)
In-Reply-To: <20250205144506.663819-3-nilay@linux.ibm.com>
On Wed, Feb 05, 2025 at 08:14:48PM +0530, Nilay Shroff wrote:
> The sysfs attributes are already protected with sysfs/kernfs internal
> locking. So acquiring q->sysfs_lock is not needed while accessing sysfs
> attribute files. So this change helps avoid holding q->sysfs_lock while
> accessing sysfs attribute files.
the sysfs/kernfs locking only protects against other accesses using
sysfs. But that's not really the most interesting part here. We
also want to make sure nothing changes underneath in a way that
could cause crashes (and maybe even torn information).
We'll really need to audit what is accessed in each method and figure
out what protects it. Chances are that sysfs_lock provides that
protection in some case right now, and chances are also very high
that a lot of this is pretty broken.
next prev parent reply other threads:[~2025-02-05 15:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 14:44 [PATCH 0/2] block: fix lock order and remove redundant locking Nilay Shroff
2025-02-05 14:44 ` [PATCH 1/2] block: fix lock ordering between the queue ->sysfs_lock and freeze-lock Nilay Shroff
2025-02-05 15:59 ` Christoph Hellwig
2025-02-06 13:22 ` Nilay Shroff
2025-02-06 14:15 ` Christoph Hellwig
2025-02-07 11:59 ` Ming Lei
2025-02-07 18:02 ` Nilay Shroff
2025-02-08 8:30 ` Ming Lei
2025-02-08 13:18 ` Nilay Shroff
2025-02-05 14:44 ` [PATCH 2/2] block: avoid acquiring q->sysfs_lock while accessing sysfs attributes Nilay Shroff
2025-02-05 15:53 ` Christoph Hellwig [this message]
2025-02-06 13:54 ` Nilay Shroff
2025-02-06 14:07 ` Christoph Hellwig
2025-02-07 11:03 ` Nilay Shroff
2025-02-08 10:41 ` Ming Lei
2025-02-08 12:56 ` Nilay Shroff
2025-02-09 11:41 ` Ming Lei
2025-02-09 13:41 ` Nilay Shroff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250205155330.GA14133@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=gjoyce@ibm.com \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=nilay@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).