From: hare@suse.de (Hannes Reinecke)
Subject: [PATCH 05/10] nvme: retry nvme_get_log_ext() when processing ANA log
Date: Tue, 29 May 2018 12:14:26 +0200 [thread overview]
Message-ID: <20180529101431.62271-6-hare@suse.de> (raw)
In-Reply-To: <20180529101431.62271-1-hare@suse.de>
When we can't fetch the ANA log page we should retry to ensure
that we really have nothing to read.
Signed-off-by: Hannes Reinecke <hare at suse.com>
---
drivers/nvme/host/multipath.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index a520582811f8..73bd4ff6ab06 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -19,6 +19,10 @@ module_param(multipath, bool, 0444);
MODULE_PARM_DESC(multipath,
"turn on native support for multiple controllers per subsystem");
+static u8 ana_log_retries = 5;
+module_param(ana_log_retries, byte, 0644);
+MODULE_PARM_DESC(ana_log_retries, "max number of retries retrieving ANA log");
+
/*
* If multipathing is enabled we need to always use the subsystem instance
* number for numbering our devices to avoid conflicts between subsystems that
@@ -303,7 +307,7 @@ static int nvme_process_ana_log(struct nvme_ctrl *ctrl, bool groups_only)
{
void *base = ctrl->ana_log_buf;
size_t offset = sizeof(struct nvme_ana_rsp_hdr);
- int error = 0, i;
+ int error = 0, i, retries = 0;
/*
* If anagrpid never changes we don't need to process the namespace
@@ -312,10 +316,13 @@ static int nvme_process_ana_log(struct nvme_ctrl *ctrl, bool groups_only)
if (ctrl->anacap & (1 << 6))
groups_only = true;
+resubmit:
error = nvme_get_log_ext(ctrl, NULL, NVME_LOG_ANA,
groups_only ? NVME_ANA_LOG_RGO : 0,
ctrl->ana_log_buf, ctrl->ana_log_size, 0);
if (error) {
+ if (++retries < ana_log_retries)
+ goto resubmit;
dev_warn(ctrl->device, "Failed to get ANA log: %d\n", error);
return -EIO;
}
--
2.12.3
next prev parent reply other threads:[~2018-05-29 10:14 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-29 10:14 [PATCH 00/10] nvme: ANA fixups Hannes Reinecke
2018-05-29 10:14 ` [PATCH 01/10] nvme: add missing kfree() in nvme_configure_ana() Hannes Reinecke
2018-05-29 12:16 ` Johannes Thumshirn
2018-05-29 12:39 ` Christoph Hellwig
2018-05-29 10:14 ` [PATCH 02/10] nvme: ANA transition timeout handling Hannes Reinecke
2018-05-29 12:47 ` Christoph Hellwig
2018-05-29 13:34 ` Hannes Reinecke
2018-05-29 13:47 ` Christoph Hellwig
2018-05-29 10:14 ` [PATCH 03/10] nvme: Only update capacity for optimized or non-optimized paths Hannes Reinecke
2018-05-29 12:38 ` Christoph Hellwig
2018-05-29 10:14 ` [PATCH 04/10] nvme: clear current path on ANA state change Hannes Reinecke
2018-05-29 12:22 ` Johannes Thumshirn
2018-05-29 12:43 ` Hannes Reinecke
2018-05-29 12:48 ` Christoph Hellwig
2018-05-29 10:14 ` Hannes Reinecke [this message]
2018-05-29 12:48 ` [PATCH 05/10] nvme: retry nvme_get_log_ext() when processing ANA log Christoph Hellwig
2018-05-29 10:14 ` [PATCH 06/10] nvme: simplify check for ANA in nvme_ns_id_attrs_are_visible() Hannes Reinecke
2018-05-29 12:49 ` Christoph Hellwig
2018-05-29 10:14 ` [PATCH 07/10] nvmet: make ANATT configurable Hannes Reinecke
2018-05-29 12:50 ` Christoph Hellwig
2018-05-29 10:14 ` [PATCH 08/10] nvmet: Set nanagrpid correctly Hannes Reinecke
2018-05-29 12:51 ` Christoph Hellwig
2018-05-29 13:04 ` Hannes Reinecke
2018-05-29 13:38 ` Christoph Hellwig
2018-05-29 10:14 ` [PATCH 09/10] nvmet: Set mnan correctly Hannes Reinecke
2018-05-29 12:52 ` Christoph Hellwig
2018-05-29 13:06 ` Hannes Reinecke
2018-05-29 13:40 ` Christoph Hellwig
2018-05-29 10:14 ` [PATCH 10/10] nvmet: set 'nuse' and 'nsze' to zero for inaccessible paths Hannes Reinecke
2018-05-29 12:57 ` Christoph Hellwig
2018-05-31 10:30 ` [PATCH 00/10] nvme: ANA fixups Sagi Grimberg
2018-05-31 16:26 ` Christoph Hellwig
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=20180529101431.62271-6-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.