From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 1/2] nvme: don't schedule multiple resets
Date: Thu, 6 Oct 2016 11:34:49 +0200 [thread overview]
Message-ID: <20161006093449.GB4999@lst.de> (raw)
In-Reply-To: <1475699566-5284-1-git-send-email-keith.busch@intel.com>
On Wed, Oct 05, 2016@04:32:45PM -0400, Keith Busch wrote:
> The queue_work only fails if the work is pending, but not yet running. If
> the work is running, the work item would get requeued, triggering a
> double reset. If the first reset fails for any reason, the second
> reset triggers:
>
> WARN_ON(dev->ctrl.state == NVME_CTRL_RESETTING)
>
> Hitting that schedules controller deletion for a second time, which
> potentially takes a reference on the device that is being deleted.
> If the reset occurs at the same time as a hot removal event, this causes
> a double-free.
>
> This patch has the reset helper function check if the work is busy
> prior to queueing, and changes all places that schedule resets to use
> this function. Since most users don't want to sync with that work, the
> "flush_work" is moved to the only caller that wants to sync.
Looks fine. I actually have something very similar in an old
branch, except that I also moved nvme_reset to common code
and made the fabrics drivers use it. I'll really need to get
back to that stuff..
Reviewed-by: Christoph Hellwig <hch at lst.de>
prev parent reply other threads:[~2016-10-06 9:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-05 20:32 [PATCH 1/2] nvme: don't schedule multiple resets Keith Busch
2016-10-05 20:32 ` [PATCH 2/2] nvme: Delete created IO queues on reset Keith Busch
2016-10-05 22:58 ` Sagi Grimberg
2016-10-06 1:47 ` Gabriel Krisman Bertazi
2016-10-06 9:32 ` Christoph Hellwig
2016-10-06 15:23 ` Keith Busch
2016-10-05 22:57 ` [PATCH 1/2] nvme: don't schedule multiple resets Sagi Grimberg
2016-10-06 9:34 ` Christoph Hellwig [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=20161006093449.GB4999@lst.de \
--to=hch@lst.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.