diff mbox

libmultipath: safe limit max_fds

Message ID 1477560172-8256-1-git-send-email-peng.liang5@zte.com.cn (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

peng.liang5@zte.com.cn Oct. 27, 2016, 9:22 a.m. UTC
From: PengLiang <peng.liang5@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@zte.com.cn>
---
 libmultipath/dict.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Christophe Varoqui Nov. 3, 2016, 1:15 p.m. UTC | #1
Hi PengLiang,

As no objection was raised, I'll merge this patch.
Can you resend with the necessary man page update explaining the new policy
for max_fds ?

Thanks.



On Thu, Oct 27, 2016 at 11:22 AM, <peng.liang5@zte.com.cn> wrote:

> From: PengLiang <peng.liang5@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@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
>
>
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

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;