multipath-tools libmultipath/log_pthread.c lib ...
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2009-03-30 19:58:40
Modified files:
libmultipath : log_pthread.c waiter.c
multipathd : main.c
Log message:
Fixes for bzs 465117 and 474627. I've alreay posted the upstream patch for 465117 and 474627 is not an issue upstream.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/log_pthread.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/waiter.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.1.2.3&r2=1.1.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.15&r2=1.69.2.16
libmultipath/log_pthread.c +5 -1
@@ -6,6 +6,7 @@#include <stdarg.h> #include <pthread.h> #include <sys/mman.h> +#include <limits.h> #include <memory.h>
@@ -61,6 +62,7 @@void log_thread_start (void ) { +size_t stacksize =64 *1024 ;pthread_attr_t attr;logdbg (stderr,"enter log_thread_start\n" );
@@ -74,7 +76,9 @@pthread_cond_init (logev_cond,NULL );pthread_attr_init (&attr); -pthread_attr_setstacksize (&attr,64 *1024 ); +if (stacksize <PTHREAD_STACK_MIN ) + stacksize =PTHREAD_STACK_MIN ; +pthread_attr_setstacksize (&attr, stacksize);if (log_init ("multipathd" ,0 )) {fprintf (stderr,"can't initialize log buffer\n" );
libmultipath/waiter.c +4 -1
@@ -199,6 +199,7 @@int start_waiter_thread (struct multipath *mpp,struct vectors *vecs) { +size_t stacksize =32 *1024 ;pthread_attr_t attr;struct event_thread *wp;
@@ -208,7 +209,9 @@if (pthread_attr_init (&attr)) goto out; -pthread_attr_setstacksize (&attr,32 *1024 ); +if (stacksize <PTHREAD_STACK_MIN ) + stacksize =PTHREAD_STACK_MIN ; +pthread_attr_setstacksize (&attr, stacksize);pthread_attr_setdetachstate (&attr,PTHREAD_CREATE_DETACHED ); wp =alloc_waiter ();
multipathd/main.c +8 -4
@@ -362,6 +362,7 @@struct path * pp;char empty_buff[WWID_SIZE ] = {0 };int ret; +int retrys =10 ; ret =device_ok_to_add (devname);if (ret <0 )
@@ -439,9 +440,10 @@/* * deal with asynchronous uevents :(( */ -if (mpp->action ==ACT_RELOAD ) { +if (mpp->action ==ACT_RELOAD & retrys >0 ) {condlog (0 ,"%s: uev_add_path sleep" , mpp->alias);sleep (1 ); + retrys--;update_mpp_paths (mpp, vecs->pathvec); goto rescan; }
@@ -1243,7 +1245,6 @@static int unmount_extra_devs (void ) { -int ret;char buf[LINE_MAX ];FILE *file;
@@ -1276,7 +1277,7 @@ } }fclose (file); -return ret; +return 0 ; }
@@ -1514,6 +1515,7 @@static int child (void * param) { +size_t stacksize =64 *1024 ;pthread_t check_thr, uevent_thr, uxlsnr_thr;pthread_attr_t attr;struct vectors * vecs;
@@ -1594,7 +1596,9 @@* start threads */ pthread_attr_init (&attr); -pthread_attr_setstacksize (&attr,64 *1024 ); +if (stacksize <PTHREAD_STACK_MIN ) + stacksize =PTHREAD_STACK_MIN ; +pthread_attr_setstacksize (&attr, stacksize);pthread_attr_setdetachstate (&attr,PTHREAD_CREATE_DETACHED );pthread_create (&check_thr, &attr, checkerloop, vecs);