Skip to contentSkip to conversation

libmultipath: fix flush_on_last_del config handlers

PATCH In review Guangyu Sun 2 participants 2 messages Dec 21, 2012 – Dec 22, 2012 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libmultipath: fix flush_on_last_del config handlers

From: Guangyu Sun <[email protected]>

Now flush_on_last_del cannot be set to FLUSH_DISABLED if its default value is FLUSH_ENABLED. This patch fixes the issue.

---
 libmultipath/dict.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
libmultipath/dict.c +3 -3
index e0535a6..ebc49a3 100644
@@ -508,7 +508,7 @@ def_flush_on_last_del_handler(vector strvec)
 	if ((strlen(buff) == 2 && strcmp(buff, "no") == 0) ||
 	    (strlen(buff) == 1 && strcmp(buff, "0") == 0))
 		conf->flush_on_last_del = FLUSH_DISABLED;
-	if ((strlen(buff) == 3 && strcmp(buff, "yes") == 0) ||
+	else if ((strlen(buff) == 3 && strcmp(buff, "yes") == 0) ||
 	    (strlen(buff) == 1 && strcmp(buff, "1") == 0))
 		conf->flush_on_last_del = FLUSH_ENABLED;
 	else
@@ -1214,7 +1214,7 @@ hw_flush_on_last_del_handler(vector strvec)
 	if ((strlen(buff) == 2 && strcmp(buff, "no") == 0) ||
 	    (strlen(buff) == 1 && strcmp(buff, "0") == 0))
 		hwe->flush_on_last_del = FLUSH_DISABLED;
-	if ((strlen(buff) == 3 && strcmp(buff, "yes") == 0) ||
+	else if ((strlen(buff) == 3 && strcmp(buff, "yes") == 0) ||
 	    (strlen(buff) == 1 && strcmp(buff, "1") == 0))
 		hwe->flush_on_last_del = FLUSH_ENABLED;
 	else
@@ -1609,7 +1609,7 @@ mp_flush_on_last_del_handler(vector strvec)
 	if ((strlen(buff) == 2 && strcmp(buff, "no") == 0) ||
 	    (strlen(buff) == 1 && strcmp(buff, "0") == 0))
 		mpe->flush_on_last_del = FLUSH_DISABLED;
-	if ((strlen(buff) == 3 && strcmp(buff, "yes") == 0) ||
+	else if ((strlen(buff) == 3 && strcmp(buff, "yes") == 0) ||
 	    (strlen(buff) == 1 && strcmp(buff, "1") == 0))
 		mpe->flush_on_last_del = FLUSH_ENABLED;
 	else

-- 1.7.9.5

#1 lore raw
Quoted 2 lines · Guangyu Sun

Now flush_on_last_del cannot be set to FLUSH_DISABLED if its default value is FLUSH_ENABLED. This patch fixes the issue.

Good catch. Applied.

Thanks,
Christophe Varoqui,
http://www.opensvc.com