From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27544 invoked by alias); 4 Jul 2006 18:57:27 -0000 Received: (qmail 27531 invoked by uid 9447); 4 Jul 2006 18:57:27 -0000 Date: Tue, 04 Jul 2006 18:57:00 -0000 Message-ID: <20060704185727.27529.qmail@sourceware.org> From: agk@sourceware.org To: lvm2-cvs@sourceware.org Subject: LVM2 ./WHATS_NEW dmeventd/mirror/dmeventd_mirror.c Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00001.txt.bz2 List-Id: CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2006-07-04 18:57:27 Modified files: . : WHATS_NEW dmeventd/mirror: dmeventd_mirror.c Log message: Add mutex to dmeventd_mirror to avoid concurrent execution. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.404&r2=1.405 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/dmeventd/mirror/dmeventd_mirror.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7 --- LVM2/WHATS_NEW 2006/06/14 20:27:15 1.404 +++ LVM2/WHATS_NEW 2006/07/04 18:57:26 1.405 @@ -1,5 +1,7 @@ Version 2.02.07 - ================================= + Add mutex to dmeventd_mirror to avoid concurrent execution. + Fix vgreduce --removemissing to return success if VG is already consistent. Fix return code if VG specified on command line is not found. Fix PV tools to include orphaned PVs in default output again. Fixed unaligned access when using clvm. --- LVM2/dmeventd/mirror/dmeventd_mirror.c 2006/05/11 19:45:53 1.6 +++ LVM2/dmeventd/mirror/dmeventd_mirror.c 2006/07/04 18:57:27 1.7 @@ -31,6 +31,8 @@ #define ME_INSYNC 1 #define ME_FAILURE 2 +static pthread_mutex_t _lock = PTHREAD_MUTEX_INITIALIZER; + /* FIXME: We may need to lock around operations to these */ static int register_count = 0; static struct dm_pool *mem_pool = NULL; @@ -150,6 +152,10 @@ char *target_type = NULL; char *params; + if (pthread_mutex_trylock(&_lock)) { + syslog(LOG_NOTICE, "Another thread is handling an event. Waiting..."); + pthread_mutex_lock(&_lock); + } /* FIXME Move inside libdevmapper */ if (!(dmt = dm_task_create(DM_DEVICE_STATUS))) { syslog(LOG_ERR, "Unable to create dm_task.\n"); @@ -204,6 +210,7 @@ fail: if (dmt) dm_task_destroy(dmt); + pthread_mutex_unlock(&_lock); } int register_device(const char *device)