All of lore.kernel.org
 help / color / mirror / Atom feed
From: hare@suse.de (Hannes Reinecke)
Subject: [PATCH 0/3] nvme: fixup race with namespace removal
Date: Wed, 27 Mar 2019 09:09:26 +0100	[thread overview]
Message-ID: <20190327080929.27918-1-hare@suse.de> (raw)

Hi all,

nvme namespace scanning might race with controller reset, causing the
system to crash in myriad ways if nvme_scan_ns_list() decides to remove
a namespace while resetting is active on another thread.
The main problem here is that namespace removal is not atomic.
The namespace mutex needs to be dropped before calling nvme_ns_remove(),
so if nvme_ns_remove() is called while traversing the list of namespaces
there always will be a race condition.

This patchset tries to fix this problem by shortening the race window
and check for valid namespaces in nvme_start_queue()/nvme_stop_queue().

As usual, comments and reviews are welcome.

Hannes Reinecke (3):
  nvme: do not quiesce or unquiesce invalid namespaces
  nvme: shorten race window in nvme_ns_remove()
  nvme-multipath: test namespace state when selecting a new path

 drivers/nvme/host/core.c      | 18 ++++++++++++------
 drivers/nvme/host/multipath.c |  6 ++++--
 2 files changed, 16 insertions(+), 8 deletions(-)

-- 
2.16.4

             reply	other threads:[~2019-03-27  8:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27  8:09 Hannes Reinecke [this message]
2019-03-27  8:09 ` [PATCH 1/3] nvme: do not quiesce or unquiesce invalid namespaces Hannes Reinecke
2019-03-27  8:09 ` [PATCH 2/3] nvme: shorten race window in nvme_ns_remove() Hannes Reinecke
2019-03-27 14:02   ` Christoph Hellwig
2019-03-27 14:41     ` Hannes Reinecke
2019-03-27 14:20   ` Keith Busch
2019-03-27 15:12     ` Hannes Reinecke
2019-03-27 18:50       ` James Smart
2019-03-28  9:27         ` Hannes Reinecke
2019-03-28 11:07           ` Ming Lei
2019-03-28 11:48             ` Hannes Reinecke
2019-03-28 12:11               ` Hannes Reinecke
2019-03-28 15:19                 ` Ming Lei
2019-03-28 15:56                   ` James Smart
2019-03-28 15:46                 ` James Smart
2019-03-28 15:57                   ` Hannes Reinecke
2019-03-28 17:50                     ` James Smart
2019-03-28 15:05           ` James Smart
2019-03-28 15:50             ` Hannes Reinecke
2019-03-29  0:40               ` Ming Lei
2019-03-27  8:09 ` [PATCH 3/3] nvme-multipath: test namespace state when selecting a new path Hannes Reinecke

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=20190327080929.27918-1-hare@suse.de \
    --to=hare@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.