[PATCH] libmultipath: fix setting of fast_io_fail_tmo

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

 



From: PengLiang <peng.liang5@xxxxxxxxxx>

As MP_FAST_IO_FAIL_ZERO define to -2, it means -1 and -2 will be sscanf to
*int_ptr in set_fast_io_fail. Then, -1 will be snprintf to 'off' and -2 will
be snprintf to '0' in print_fast_io_fail.
So it will showing the wrong config if user set fast_io_fail_tmo to -1 or -2.
But in fact, -1 or -2 is a invalid config.

Signed-off-by: PengLiang <peng.liang5@xxxxxxxxxx>
---
 libmultipath/dict.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index 7c21e72..b02a29b 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -573,7 +573,7 @@ set_fast_io_fail(vector strvec, void *ptr)
 	if (strcmp(buff, "off") == 0)
 		*int_ptr = MP_FAST_IO_FAIL_OFF;
 	else if (sscanf(buff, "%d", int_ptr) != 1 ||
-		 *int_ptr < MP_FAST_IO_FAIL_ZERO)
+		 *int_ptr < 0)
 		*int_ptr = MP_FAST_IO_FAIL_UNSET;
 	else if (*int_ptr == 0)
 		*int_ptr = MP_FAST_IO_FAIL_ZERO;
-- 
2.8.1.windows.1

--
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