linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH-4.5-v3 2/5] NVMe: Fix namespace removal deadlock
Date: Thu, 18 Feb 2016 16:26:14 +0000	[thread overview]
Message-ID: <20160218162613.GB4901@localhost.localdomain> (raw)
In-Reply-To: <20160218040956.GB12379@infradead.org>

On Wed, Feb 17, 2016@08:09:56PM -0800, Christoph Hellwig wrote:
> On Thu, Feb 18, 2016@02:00:47AM +0000, Wenbo Wang wrote:
> > Without this mutex, is it safe to run concurrently with nvme_free_ns which manipulates the list?
> 
> see the first patch for an explanation on why this should be safe.

I think the potential problem Wenbo is talking about is if someone is
holding an open reference (mounted, for example) after detaching the
namespace.

Removing it from the list when all references are released keeps the list
consistent with the block layer so that attaching a different namespace
with the same NSID won't create a naming conflict. The newly attached
namespace isn't be usable in this case, though.

Instead of using NSID, I think the disk name should use an IDA like the
controller's instance. Then we can unlink the namespace from the list
when detached instead of with the last reference.

The downside is you can't infer the NSID from the name, but we have
NVME_IOCTL_ID and /sys/block/nvmeXnY/nsid for that.

  reply	other threads:[~2016-02-18 16:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 18:36 [PATCH-4.5-v3 0/5] NVMe hot plug stuff Keith Busch
2016-02-17 18:36 ` [PATCH-4.5-v3 1/5] NVMe: Add controller removing state Keith Busch
2016-02-18  4:09   ` Christoph Hellwig
2016-02-18  9:37   ` Johannes Thumshirn
2016-02-17 18:36 ` [PATCH-4.5-v3 2/5] NVMe: Fix namespace removal deadlock Keith Busch
2016-02-18  2:00   ` Wenbo Wang
2016-02-18  4:09     ` Christoph Hellwig
2016-02-18 16:26       ` Keith Busch [this message]
2016-02-18  9:39   ` Johannes Thumshirn
2016-02-21 16:17   ` Christoph Hellwig
2016-02-17 18:36 ` [PATCH-4.5-v3 3/5] NVMe: Simplify device reset failure Keith Busch
2016-02-17 18:36 ` [PATCH-4.5-v3 4/5] NVMe: Move error handling to failed reset handler Keith Busch
2016-02-18  4:11   ` Christoph Hellwig
2016-02-18 19:38     ` Keith Busch
2016-02-18  9:42   ` Johannes Thumshirn
2016-02-17 18:36 ` [PATCH-4.5-v3 5/5] NVMe: Don't unmap controller registers on reset Keith Busch
2016-02-18  9:45   ` Johannes Thumshirn
2016-02-21 16:15   ` Christoph Hellwig

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=20160218162613.GB4901@localhost.localdomain \
    --to=keith.busch@intel.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).