Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCHv2] NVMe: Fix removal in case of active namespace list scanning method
Date: Fri, 27 May 2016 09:28:36 -0400	[thread overview]
Message-ID: <20160527132834.GA19990@localhost.localdomain> (raw)
In-Reply-To: <1464344983-19521-1-git-send-email-sunad.s@samsung.com>

On Fri, May 27, 2016@03:59:43PM +0530, Sunad Bhandary S wrote:
>  static int nvme_scan_ns_list(struct nvme_ctrl *ctrl, unsigned nn)
>  {
>  	struct nvme_ns *ns;
> @@ -1497,7 +1508,7 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl, unsigned nn)
>  	for (i = 0; i < num_lists; i++) {
>  		ret = nvme_identify_ns_list(ctrl, prev, ns_list);
>  		if (ret)
> -			goto out;
> +			goto free;
>  
>  		for (j = 0; j < min(nn, 1024U); j++) {
>  			nsid = le32_to_cpu(ns_list[j]);
> @@ -1515,13 +1526,14 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl, unsigned nn)
>  		nn -= j;
>  	}
>   out:
> +	nvme_remove_invalid_namespaces(ctrl, prev);
> + free:

We don't want to remove the namespaces on error here. That could remove
valid, in use namespaces: if nvme_identify_ns_list fails (maybe controller
just doesn't support that identify mode), we do the sequential scanning.

Just leave the 'goto free' alone, and call nvme_remove_invalid_namespaces
only on success.

  reply	other threads:[~2016-05-27 13:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27 10:29 [PATCHv2] NVMe: Fix removal in case of active namespace list scanning method Sunad Bhandary S
2016-05-27 13:28 ` Keith Busch [this message]
2016-05-30 10:45   ` Sunad Bhandary
2016-05-31 14:35     ` Keith Busch
2016-06-08  5:13       ` Sunad Bhandary

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=20160527132834.GA19990@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