All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] fabrics: ignore hostnqn file if its empty
@ 2020-02-12 20:01 Sagi Grimberg
  2020-02-12 20:01 ` [PATCH 2/2] fabrics: set keep_alive_tmo also for discovery controllers Sagi Grimberg
  2020-02-14 14:29 ` [PATCH 1/2] fabrics: ignore hostnqn file if its empty Keith Busch
  0 siblings, 2 replies; 3+ messages in thread
From: Sagi Grimberg @ 2020-02-12 20:01 UTC (permalink / raw)
  To: linux-nvme, Keith Busch

If we read an empty string from /etc/nvme/hostnqn we should
ignore it instead of passing an empty string to the
driver resulting in the error:

nvme_fabrics: unknown parameter or missing value 'hostnqn=' in ctrl creation request

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
 fabrics.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fabrics.c b/fabrics.c
index 254a2be615ac..4b5c9669edc7 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -677,7 +677,8 @@ static char *hostnqn_read_file(void)
 	if (f == NULL)
 		return false;
 
-	if (fgets(hostnqn, sizeof(hostnqn), f) == NULL)
+	if (fgets(hostnqn, sizeof(hostnqn), f) == NULL ||
+	    !strlen(hostnqn))
 		goto out;
 
 	ret = strndup(hostnqn, strcspn(hostnqn, "\n"));
-- 
2.20.1


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-14 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12 20:01 [PATCH 1/2] fabrics: ignore hostnqn file if its empty Sagi Grimberg
2020-02-12 20:01 ` [PATCH 2/2] fabrics: set keep_alive_tmo also for discovery controllers Sagi Grimberg
2020-02-14 14:29 ` [PATCH 1/2] fabrics: ignore hostnqn file if its empty Keith Busch

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.