From: Christoph Hellwig <hch@lst.de>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: linux-nvme@lists.infradead.org, Christoph Hellwig <hch@lst.de>,
Keith Busch <kbusch@kernel.org>,
Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Subject: Re: [PATCH] nvmet: fix ns enable/disable possible hang
Date: Tue, 21 May 2024 21:39:06 +0200 [thread overview]
Message-ID: <20240521193906.GA30536@lst.de> (raw)
In-Reply-To: <20240521085623.87681-2-sagi@grimberg.me>
On Tue, May 21, 2024 at 11:56:23AM +0300, Sagi Grimberg wrote:
> When disabling an nvmet namespace, there is a period where
> the subsys->lock is released, as the ns disable waits for
> backend IO to complete, and the ns percpu ref to be properly
> killed. The original intent was to avoid taking the subsystem
> lock for a prolong period as other processes may need to acquire
> it (for example new incoming connections).
>
> However, it opens up a window where another process may come in
> and enable the ns, (re)intiailizing the ns percpu_ref, causing
> the disable sequence to hang.
>
> Solve this by taking the global nvmet_config_sem over the entire
> configfs enable/disable sequence.
Can you use up all 73 characters for the commit log and add a little
comment to the code on why nvmet_config_sem is taken to the code?
With that this looks good to me.
next prev parent reply other threads:[~2024-05-21 19:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 8:56 [PATCH blktests] nvme: add regression test for concurrently enable/disable nvmet ns Sagi Grimberg
2024-05-21 8:56 ` [PATCH] nvmet: fix ns enable/disable possible hang Sagi Grimberg
2024-05-21 19:39 ` Christoph Hellwig [this message]
2024-05-22 0:45 ` Chaitanya Kulkarni
2024-05-21 10:07 ` [PATCH blktests] nvme: add regression test for concurrently enable/disable nvmet ns Sagi Grimberg
2024-05-22 3:46 ` Yi Zhang
2024-05-22 0:54 ` Chaitanya Kulkarni
2024-05-22 8:58 ` Sagi Grimberg
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=20240521193906.GA30536@lst.de \
--to=hch@lst.de \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=kbusch@kernel.org \
--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