Skip to contentSkip to conversation

nvmet: do not return 'reserved' for empty TSAS values

PATCH In review Hannes Reinecke 3 participants 3 messages Jun 14, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmet: do not return 'reserved' for empty TSAS values

The 'TSAS' value is only defined for TCP and RDMA, but returning 'reserved' for undefined values tricked nvmetcli to try to write 'reserved' when restoring from a config file. This caused an error and the configuration would not be applied.

Fixes 3f123494db72 ("nvmet: make TCP sectype settable via configfs")
---
 drivers/nvme/target/configfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/configfs.c +1 -1
index bd87dfd173a4..e60224356048 100644
@@ -410,7 +410,7 @@ static ssize_t nvmet_addr_tsas_show(struct config_item *item,
 				return sprintf(page, "%s\n", nvmet_addr_tsas_rdma[i].name);
 		}
 	}
-	return sprintf(page, "reserved\n");
+	return sprintf(page, "\n");
 }
 
 static ssize_t nvmet_addr_tsas_store(struct config_item *item,
Signature · 1 line
2.35.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Hannes Reinecke

The 'TSAS' value is only defined for TCP and RDMA, but returning 'reserved' for undefined values tricked nvmetcli to try to write 'reserved' when restoring from a config file. This caused an error and the configuration would not be applied.

Looks good:

Reviewed-by on v1 1/1
#2 lore raw
In reply to Hannes Reinecke
Quoted 8 lines · Hannes Reinecke

The 'TSAS' value is only defined for TCP and RDMA, but returning 'reserved' for undefined values tricked nvmetcli to try to write 'reserved' when restoring from a config file. This caused an error and the configuration would not be applied.

Fixes 3f123494db72 ("nvmet: make TCP sectype settable via configfs")

Looks good.

-ck