From patchwork Wed Feb 3 11:39:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Zeffertt X-Patchwork-Id: 76693 Received: from mx01.util.phx2.redhat.com (mx1-phx2.redhat.com [209.132.183.26]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o13Bh3s0016358 for ; Wed, 3 Feb 2010 11:43:39 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.util.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o13BdmEB029688; Wed, 3 Feb 2010 06:39:50 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o13BdlqW008047 for ; Wed, 3 Feb 2010 06:39:47 -0500 Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.14]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o13BdfOt012165 for ; Wed, 3 Feb 2010 06:39:42 -0500 Received: from SMTP.EU.CITRIX.COM (smtp.eu.citrix.com [62.200.22.115]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o13BdQDN019174 for ; Wed, 3 Feb 2010 06:39:26 -0500 X-IronPort-AV: E=Sophos;i="4.49,397,1262563200"; d="scan'208";a="9248112" Received: from lonpmailmx01.citrite.net ([10.30.224.162]) by LONPIPO01.EU.CITRIX.COM with ESMTP; 03 Feb 2010 11:39:26 +0000 Received: from [10.80.2.38] (10.80.2.38) by smtprelay.citrix.com (10.30.224.162) with Microsoft SMTP Server id 8.1.393.1; Wed, 3 Feb 2010 11:39:25 +0000 Message-ID: <4B69606D.2090206@eu.citrix.com> Date: Wed, 3 Feb 2010 11:39:25 +0000 From: Alex Zeffertt User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: dm-devel@redhat.com X-RedHat-Spam-Score: -0.17 (AWL) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.14 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH] multipathd pthread locking fix X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 03 Feb 2010 11:43:39 +0000 (UTC) Fix pthread bug in multipath-tools. You should lock the mutex before doing a pthread_cond_wait otherwise undefined results occur. In fact we get away with this with glibc, but with uclibc it causes a segfault. Signed-off-by: Alex Zeffertt --- ./multipathd/main.c.orig 2010-02-03 05:42:14.000000000 -0500 +++ ./multipathd/main.c 2010-02-03 05:43:13.000000000 -0500 @@ -1668,6 +1668,7 @@ /*pthread_create(&uevent_thr, &attr, ueventloop, vecs);*/ pthread_create(&uxlsnr_thr, &attr, uxlsnrloop, vecs); + lock(&exit_mutex); pthread_cond_wait(&exit_cond, &exit_mutex); /*