From f18eeb4da89894d486701ad8657b4d23f9e6686c Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Fri, 21 Nov 2008 13:48:00 +0000 Subject: [PATCH] Fix a starup race in clvmd that could result in huge waits for the first command to be processed. --- WHATS_NEW | 1 + daemons/clvmd/clvmd.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 7a00f7f3c..581c5ab2d 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.44 - ==================================== + Fix startup race in clvmd. Generate Red Hat clvmd startup script at configuration time with correct paths. Fix clvmd & dmeventd builds after tree restructuring. Cope with snapshot dependencies when removing a whole VG with lvremove. diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c index eb34eaf97..93a0cb7fa 100644 --- a/daemons/clvmd/clvmd.c +++ b/daemons/clvmd/clvmd.c @@ -423,6 +423,9 @@ int main(int argc, char *argv[]) /* This needs to be started after cluster initialisation as it may need to take out locks */ DEBUGLOG("starting LVM thread\n"); + + /* Don't let anyone else to do work until we are started */ + pthread_mutex_lock(&lvm_start_mutex); pthread_create(&lvm_thread, NULL, lvm_thread_fn, (void *)(long)using_gulm); @@ -1758,9 +1761,6 @@ static __attribute__ ((noreturn)) void *lvm_thread_fn(void *arg) sigset_t ss; int using_gulm = (int)(long)arg; - /* Don't let anyone else to do work until we are started */ - pthread_mutex_lock(&lvm_start_mutex); - DEBUGLOG("LVM thread function started\n"); /* Ignore SIGUSR1 & 2 */ -- 2.43.5