From patchwork Mon Mar 30 19:58:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bmarzins@sourceware.org X-Patchwork-Id: 15246 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2UJxDtK003566 for ; Mon, 30 Mar 2009 19:59:13 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 4085C619AB8; Mon, 30 Mar 2009 15:59:13 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n2UJx4Xn012734 for ; Mon, 30 Mar 2009 15:59:04 -0400 Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n2UJx4ks008678 for ; Mon, 30 Mar 2009 15:59:04 -0400 Received: from sourceware.org (sourceware.org [209.132.176.174]) by mx3.redhat.com (8.13.8/8.13.8) with SMTP id n2UJwjYV019464 for ; Mon, 30 Mar 2009 15:58:45 -0400 Received: (qmail 25177 invoked by uid 9475); 30 Mar 2009 19:58:41 -0000 Date: 30 Mar 2009 19:58:41 -0000 Message-ID: <20090330195841.25175.qmail@sourceware.org> From: bmarzins@sourceware.org To: dm-cvs@sourceware.org, dm-devel@redhat.com X-RedHat-Spam-Score: -3.946 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.32 X-loop: dm-devel@redhat.com Cc: Subject: [dm-devel] multipath-tools libmultipath/log_pthread.c lib ... X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com CVSROOT: /cvs/dm Module name: multipath-tools Branch: RHEL5_FC6 Changes by: bmarzins@sourceware.org 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 --- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel --- multipath-tools/libmultipath/log_pthread.c 2008/08/27 19:14:57 1.1.2.2 +++ multipath-tools/libmultipath/log_pthread.c 2009/03/30 19:58:38 1.1.2.3 @@ -6,6 +6,7 @@ #include #include #include +#include #include @@ -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"); --- multipath-tools/libmultipath/waiter.c 2008/09/08 22:01:20 1.1.2.3 +++ multipath-tools/libmultipath/waiter.c 2009/03/30 19:58:39 1.1.2.4 @@ -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(); --- multipath-tools/multipathd/main.c 2009/03/26 03:28:09 1.69.2.15 +++ multipath-tools/multipathd/main.c 2009/03/30 19:58:40 1.69.2.16 @@ -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);