public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: agk@sourceware.org
To: lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW dmeventd/mirror/dmeventd_mirror.c
Date: Tue, 04 Jul 2006 18:57:00 -0000	[thread overview]
Message-ID: <20060704185727.27529.qmail@sourceware.org> (raw)

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)


             reply	other threads:[~2006-07-04 18:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-04 18:57 agk [this message]
2006-12-20 14:34 agk
2007-01-11 19:52 agk
2007-01-23 17:40 agk
2007-01-25 23:32 agk
2008-09-25 15:52 mbroz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060704185727.27529.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).