linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Nadolski, Edmund" <edmund.nadolski@intel.com>
To: Keith Busch <kbusch@kernel.org>,
	Edmund Nadolski <edmund.nadolski@intel.com>
Cc: linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme: clear stale nvmeq->tags after tagset free
Date: Thu, 16 Jan 2020 15:06:40 -0700	[thread overview]
Message-ID: <0ff9ee57-0211-0170-7c58-a6c5d9354beb@intel.com> (raw)
In-Reply-To: <20200116160602.GA28993@redsun51.ssa.fujisawa.hgst.com>

On 1/16/2020 9:06 AM, Keith Busch wrote:
> On Tue, Jan 14, 2020 at 11:17:45AM -0700, Edmund Nadolski wrote:
>> +static void nvme_exit_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
>> +{
>> +	struct nvme_queue *nvmeq = hctx->driver_data;
>> +
>> +	nvmeq->tags = NULL;
>> +}
> 
> If you've multiple namespaces, disconnecting one of them will cause the
> shared nvmeq to have NULL tags, which will crash the kernel on the very
> next CQE read.

Currently it crashes with just a single namespace, because the nvmeq->tags is 
still pointing into a tagset that was previously released by calling 
nvme_free_tagset() from nvme_reset_work().

Perhaps the driver should not free the tagset unless & until there are no more 
namespaces?  Is nvme_remove_namespaces() supposed to ensure that?

Thanks,
Ed

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2020-01-16 22:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 18:17 [PATCH] nvme: clear stale nvmeq->tags after tagset free Edmund Nadolski
2020-01-16 16:06 ` Keith Busch
2020-01-16 22:06   ` Nadolski, Edmund [this message]
2020-01-16 23:26     ` Keith Busch
2020-01-21 17:32       ` Nadolski, Edmund
2020-01-21 17:42         ` Keith Busch
2020-01-21 18:49           ` Nadolski, Edmund
2020-01-21 19:12             ` Keith Busch
2020-01-21 19:26               ` Nadolski, Edmund

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=0ff9ee57-0211-0170-7c58-a6c5d9354beb@intel.com \
    --to=edmund.nadolski@intel.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /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).