linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: linux-nvme@lists.infradead.org
Subject: Re: [PATCH 2/2] nvme: add 'queue_if_no_path' semantics
Date: Thu, 11 Mar 2021 13:41:14 +0100	[thread overview]
Message-ID: <526fbe54-cbc8-383a-c087-09018ac9b2a8@suse.de> (raw)
In-Reply-To: <68ca5a63-e6e3-be5a-4b60-bd9db52ac9c1@grimberg.me>

On 3/5/21 9:11 PM, Sagi Grimberg wrote:
> 
>> I think what you're showing is a problem for everyone, including
>> fabrics. The namespace was attached to the previously existing
>> subsystem, nvme1, but we didn't find the previously existing "head" to
>> reattach the namespace.
>>
>> I just threw the below together very hastily, so I'm sure there's
>> something wrong with it, but just to capture what's wrong with the
>> current code:
>>
>> ---
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index 3833584b5cee..0b3bbbe6d1e8 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -3897,8 +3897,6 @@ static void nvme_ns_remove(struct nvme_ns *ns)
>>         mutex_lock(&ns->ctrl->subsys->lock);
>>       list_del_rcu(&ns->siblings);
>> -    if (list_empty(&ns->head->list))
>> -        list_del_init(&ns->head->entry);
> 
> Not removing it ever from the head->list?
> 
>>       mutex_unlock(&ns->ctrl->subsys->lock);
>>         synchronize_rcu(); /* guarantee not available in head->list */
>> -- 
> 
> This is a problem. beacuse if you don't remove the ns from the
> head->list nothing prevents it from being re-selected as the
> current_path after we synchronize the srcu, although it is going away...
> 
You misread the patch.
I'm not skipping the removal from 'head->list', I'm skipping the removal
from 'subsys->nsheads' (which is where 'head->entry' is pointing to).


But I'll be sending an updated patch which clarifies this situation.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		           Kernel Storage Architect
hare@suse.de			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer

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

      reply	other threads:[~2021-03-11 12:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 12:44 [RFC PATCHv3 0/2] nvme: queue_if_no_path functionality Hannes Reinecke
2020-10-05 12:44 ` [PATCH 1/2] nvme-mpath: delete disk after last connection Hannes Reinecke
2020-10-05 12:50   ` Christoph Hellwig
2021-03-05 20:06     ` Sagi Grimberg
2021-03-04 14:34   ` Daniel Wagner
2020-10-05 12:45 ` [PATCH 2/2] nvme: add 'queue_if_no_path' semantics Hannes Reinecke
2020-10-05 12:52   ` Christoph Hellwig
2020-10-06  5:48     ` Hannes Reinecke
2020-10-06  7:51       ` Christoph Hellwig
2020-10-06  8:07         ` Hannes Reinecke
2020-10-06  8:27           ` Christoph Hellwig
2020-10-06  8:29             ` Hannes Reinecke
2020-10-06  8:39               ` Christoph Hellwig
2020-10-06 13:30                 ` Hannes Reinecke
2020-10-06 13:45                   ` Hannes Reinecke
2021-03-05 20:31                     ` Sagi Grimberg
2021-03-08 13:17                       ` Hannes Reinecke
2021-03-15 17:21                         ` Sagi Grimberg
2020-10-06 17:41                   ` Keith Busch
2021-03-05 20:11                     ` Sagi Grimberg
2021-03-11 12:41                       ` Hannes Reinecke [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=526fbe54-cbc8-383a-c087-09018ac9b2a8@suse.de \
    --to=hare@suse.de \
    --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).