From: Niels Dossche <dossche.niels@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-nvme@lists.infradead.org, Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>,
Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH v2] nvmet: add missing locks around nvmet_ns_revalidate
Date: Thu, 10 Mar 2022 13:46:22 +0100 [thread overview]
Message-ID: <9a019440-98a5-983e-0fbb-ef9bed0193a6@gmail.com> (raw)
In-Reply-To: <20220310063846.GA24359@lst.de>
On 10/03/2022 07:38, Christoph Hellwig wrote:
> On Thu, Mar 10, 2022 at 02:25:11AM +0100, Niels Dossche wrote:
>> nvmet_ns_changed states via lockdep that the ns->subsys->lock must be
>> held. The only caller of nvmet_ns_changed which does not acquire that
>> lock is nvmet_ns_revalidate.
>
> So acquire it in nvmet_ns_revalidate only when we actually call
> nvmet_ns_changed. Otherwise we take a subsystem-wide lock for every
> Identify Namespace all.
There are 3 callers of nvmet_ns_revalidate, of which 2 do not acquire the lock and 1 does.
I'll send a v3 patch which does the locking locally inside that if check by adding an additional argument to indicate whether the lock should be acquired or not.
Thanks.
prev parent reply other threads:[~2022-03-10 12:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 1:25 [PATCH v2] nvmet: add missing locks around nvmet_ns_revalidate Niels Dossche
2022-03-10 1:50 ` Chaitanya Kulkarni
2022-03-10 6:38 ` Christoph Hellwig
2022-03-10 12:46 ` Niels Dossche [this message]
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=9a019440-98a5-983e-0fbb-ef9bed0193a6@gmail.com \
--to=dossche.niels@gmail.com \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=kch@nvidia.com \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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