From 0891f2277dc9db11cbb1e734a7815805161ab92f Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 25 Apr 2024 15:54:53 +0200 Subject: [PATCH] nbft: Skip SSNS records pointing to well-known discovery NQN Depending on a pre-OS implementation, boot attempts pointing to the well-known discovery NQN may get transformed in an SSNS record (and marked as 'unavailable') in case the discovery cannot be performed. Otherwise the NBFT table should be populated by discovered records instead. Signed-off-by: Tomas Bzatek --- nbft.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nbft.c b/nbft.c index 995b31ca54..9d1834d0db 100644 --- a/nbft.c +++ b/nbft.c @@ -335,6 +335,15 @@ int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg, for (i = 0; i < (*ss)->num_hfis; i++) { hfi = (*ss)->hfis[i]; + /* Skip discovery NQN records */ + if (strcmp((*ss)->subsys_nqn, NVME_DISC_SUBSYS_NAME) == 0) { + if (verbose >= 1) + fprintf(stderr, + "SSNS %d points to well-known discovery NQN, skipping\n", + (*ss)->index); + continue; + } + host_traddr = NULL; if (!cfg->host_traddr && !strncmp((*ss)->transport, "tcp", 3))