Re: [PATCH 14/14] nvme: limit warnings from nvme_identify_ns

2018-05-28 Thread Johannes Thumshirn
Looks good,
Reviewed-by: Johannes Thumshirn 
-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


[PATCH 14/14] nvme: limit warnings from nvme_identify_ns

2018-05-26 Thread Christoph Hellwig
When rescanning namespaces after an AEN we will issue Identify Namespace
comands to namespaces that have gone away, so don't warn for this specific
case.

Signed-off-by: Christoph Hellwig 
---
 drivers/nvme/host/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 1ae77428a1a5..7ad3cfc9d4e1 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -984,7 +984,9 @@ static struct nvme_id_ns *nvme_identify_ns(struct nvme_ctrl 
*ctrl,
 
error = nvme_submit_sync_cmd(ctrl->admin_q, , id, sizeof(*id));
if (error) {
-   dev_warn(ctrl->device, "Identify namespace failed\n");
+   /* don't warn on a namespace that has gone away */
+   if (error < 0 || ((error & ~NVME_SC_DNR) != NVME_SC_INVALID_NS))
+   dev_warn(ctrl->device, "Identify namespace failed\n");
kfree(id);
return NULL;
}
-- 
2.17.0