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>
Signed-off-by: Keith Busch <kbusch@kernel.org>
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"));