[PATCH] libmultipath: fix flush_on_last_del config handlers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Guangyu Sun <guangyu.sun@xxxxxxxxxx>

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

Signed-off-by: Guangyu Sun <guangyu.sun@xxxxxxxxxx>
---
 libmultipath/dict.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index e0535a6..ebc49a3 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -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

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel


[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux