multipath-tools ./multipath.conf.annotated lib ...
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2008-08-29 21:30:34
Modified files:
. : multipath.conf.annotated libmultipath : dict.c structs.h multipathd : main.c
Log message:
Fix for bz #457226. The kernel doesn't allow "ulimit -n unlimited" because you can't set the max number of open fds greater than NR_OPEN. So multipath's max_fds config option now allows the value "max" instead of "unlimited", which sets the max open fds to NR_OPEN.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.annotated.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.18.2.6&r2=1.18.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.17.2.5&r2=1.17.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.18.2.3&r2=1.18.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.8&r2=1.69.2.9
multipath.conf.annotated +1 -1
@@ -84,7 +84,7 @@ # # scope : multipathd # # desc : Sets the maximum number of open file descriptors for the # # multipathd process. -# # values : unlimited|n > 0 +# # values : max|n > 0 # # default : None # # # max_fds 8192
libmultipath/dict.c +4 -4
@@ -155,8 +155,8 @@return 1 ;if (strlen (buff) ==9 && - !strcmp (buff,"unlimited" )) - conf->max_fds =MAX_FDS_UNLIMITED ; + !strcmp (buff,"max" )) + conf->max_fds =MAX_FDS_MAX ;else conf->max_fds =atoi (buff);FREE (buff);
@@ -1653,8 +1653,8 @@if (!conf->max_fds)return 0 ; -if (conf->max_fds <0 ) -return snprintf (buff, len,"unlimited" ); +if (conf->max_fds ==MAX_FDS_MAX ) +return snprintf (buff, len,"max" );return snprintf (buff, len,"%d" , conf->max_fds); }
libmultipath/structs.h +1 -1
@@ -20,7 +20,7 @@#define NO_PATH_RETRY_FAIL -1#define NO_PATH_RETRY_QUEUE -2 -#define MAX_FDS_UNLIMITED -1 +#define MAX_FDS_MAX (1024 * 1024)enum free_path_switch {KEEP_PATHS ,
multipathd/main.c +3 -8
@@ -1479,14 +1479,9 @@if (conf->max_fds) {struct rlimit fd_limit; -if (conf->max_fds >0 ) { - fd_limit.rlim_cur = conf->max_fds; - fd_limit.rlim_max = conf->max_fds; - } -else { - fd_limit.rlim_cur =RLIM_INFINITY ; - fd_limit.rlim_max =RLIM_INFINITY ; - } + + fd_limit.rlim_cur = conf->max_fds; + fd_limit.rlim_max = conf->max_fds;if (setrlimit (RLIMIT_NOFILE , &fd_limit) <0 )condlog (0 ,"can't set open fds limit to %d : %s\n" , conf->max_fds,strerror (errno));