libmultipath: fix flush_on_last_del config handlers
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.
Signed-off-by Guangyu Sun <[email protected]>
--- libmultipath/dict.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
libmultipath/dict.c +3 -3
@@ -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
Quoted 2 lines · Guangyu Sun
Now
flush_on_last_delcannot be set toFLUSH_DISABLEDif its default value isFLUSH_ENABLED. This patch fixes the issue.
Good catch. Applied.
Thanks,
Christophe Varoqui,
http://www.opensvc.com