Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Sagi Grimberg <sagi@grimberg.me>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: 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: Wed, 22 May 2024 00:45:20 +0000	[thread overview]
Message-ID: <e6ebe0e7-ee45-40e4-8f96-22bb2303b355@nvidia.com> (raw)
In-Reply-To: <20240521085623.87681-2-sagi@grimberg.me>

On 5/21/24 01:56, 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.
>
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
>

good catch, looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



  parent reply	other threads:[~2024-05-22  0:45 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
2024-05-22  0:45   ` Chaitanya Kulkarni [this message]
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=e6ebe0e7-ee45-40e4-8f96-22bb2303b355@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=hch@lst.de \
    --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