[dm-devel] [PATCH] libmultipath: safe limit max_fds

peng.liang5 at zte.com.cn peng.liang5 at zte.com.cn
Thu Oct 27 09:22:52 UTC 2016


From: PengLiang <peng.liang5 at zte.com.cn>

If user config the max_fds too small to less than actual open files of multipath,
it will occur the error like "/lib/superpath/libchecktur.so: cannot open shared
object file: Too many open files".
So set a safe limit to 4096 when user config max_fds less than 4096.

Signed-off-by: PengLiang <peng.liang5 at zte.com.cn>
---
 libmultipath/dict.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index 7c21e72..7291e0e 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -733,6 +733,9 @@ max_fds_handler(struct config *conf, vector strvec)
 	if (conf->max_fds > max_fds)
 		conf->max_fds = max_fds;
 
+	if (conf->max_fds < 4096)
+		conf->max_fds = 4096;
+
 	FREE(buff);
 
 	return r;
-- 
2.8.1.windows.1




More information about the dm-devel mailing list