From 45a8da55b6970b5305036899b09a418dcf7b1132 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 8 Aug 2017 14:08:45 -0700 Subject: [PATCH] nvmf: fix Mode Virtual comparison The strcasecmp() comparison was incorrect, causing "Mode Virtual" to take the opposite of the intended path. Change-Id: Ic83f451dee2c7a786a1a9b88cf426fcd5abf3037 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/373392 Tested-by: SPDK Automated Test System Reviewed-by: Ben Walker --- app/nvmf_tgt/conf.c | 2 +- app/nvmf_tgt/nvmf_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/nvmf_tgt/conf.c b/app/nvmf_tgt/conf.c index 306f46509..eb484ad97 100644 --- a/app/nvmf_tgt/conf.c +++ b/app/nvmf_tgt/conf.c @@ -269,7 +269,7 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp) if (mode) { SPDK_NOTICELOG("Mode present in the [Subsystem] section of the config file.\n" "Mode was removed as a valid parameter.\n"); - if (strcasecmp(mode, "Virtual")) { + if (strcasecmp(mode, "Virtual") == 0) { SPDK_NOTICELOG("Your mode value is 'Virtual' which is now the only possible mode.\n" "Your configuration file will work as expected.\n"); } else { diff --git a/app/nvmf_tgt/nvmf_rpc.c b/app/nvmf_tgt/nvmf_rpc.c index 1f7d459b9..da44c987a 100644 --- a/app/nvmf_tgt/nvmf_rpc.c +++ b/app/nvmf_tgt/nvmf_rpc.c @@ -309,7 +309,7 @@ spdk_rpc_construct_nvmf_subsystem(struct spdk_jsonrpc_request *request, if (req.mode) { SPDK_NOTICELOG("Mode present in the construct NVMe-oF subsystem RPC.\n" "Mode was removed as a valid parameter.\n"); - if (strcasecmp(req.mode, "Virtual")) { + if (strcasecmp(req.mode, "Virtual") == 0) { SPDK_NOTICELOG("Your mode value is 'Virtual' which is now the only possible mode.\n" "Your RPC will work as expected.\n"); } else {