[dm-devel] [PATCH] libmultipath: fix setting of fast_io_fail_tmo
peng.liang5 at zte.com.cn
peng.liang5 at zte.com.cn
Tue Oct 25 10:39:23 UTC 2016
From: PengLiang <peng.liang5 at zte.com.cn>
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 at zte.com.cn>
---
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
More information about the dm-devel
mailing list