linux-nvme.lists.infradead.org archive mirror
 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

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

We may use persistent discovery connections on referrals
so don't restrict it for discovery controllers.

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

diff --git a/fabrics.c b/fabrics.c
index 4b5c9669edc7..14b453d00e87 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -1000,7 +1000,7 @@ retry:
 		p += len;
 	}
 
-	if (cfg.keep_alive_tmo && !discover) {
+	if (cfg.keep_alive_tmo) {
 		len = sprintf(p, ",keep_alive_tmo=%d", cfg.keep_alive_tmo);
 		if (len < 0)
 			return -EINVAL;
-- 
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

* Re: [PATCH 1/2] fabrics: ignore hostnqn file if its empty
  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 ` Keith Busch
  1 sibling, 0 replies; 3+ messages in thread
From: Keith Busch @ 2020-02-14 14:29 UTC (permalink / raw)
  To: Sagi Grimberg; +Cc: linux-nvme

On Wed, Feb 12, 2020 at 12:01:57PM -0800, Sagi Grimberg wrote:
> 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>


Thanks, both patches applied.

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

^ permalink raw reply	[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 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).