From 37034fb826f20a08c05972ea9e4d50be079e5c1f Mon Sep 17 00:00:00 2001 From: Patrick Caulfield Date: Thu, 15 Nov 2007 10:16:14 +0000 Subject: [PATCH] If the pre_command fails then go back and wait patiently for the next pre function rather than retrying it until we get stuck! --- WHATS_NEW | 1 + daemons/clvmd/clvmd.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index c3dcd819e..c273a92af 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.29 - ================================== + Stop clvmd going haywire if a pre_function fails. Convert some vg_reads into vg_lock_and_reads. Avoid nested vg_reads when processing PVs in VGs and fix associated locking. Accept sizes with --readahead argument. diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c index deafecbdb..678ee4889 100644 --- a/daemons/clvmd/clvmd.c +++ b/daemons/clvmd/clvmd.c @@ -1379,8 +1379,10 @@ static __attribute__ ((noreturn)) void *pre_and_post_thread(void *arg) break; } while(1); - if (status) - continue; /* Wait for another PRE command */ + if (status) { + client->bits.localsock.state = POST_COMMAND; + goto next_pre; + } /* We may need to wait for the condition variable before running the post command */ pthread_mutex_lock(&client->bits.localsock.mutex); @@ -1409,7 +1411,7 @@ static __attribute__ ((noreturn)) void *pre_and_post_thread(void *arg) log_error("Error sending to pipe: %m\n"); break; } while(1); - +next_pre: DEBUGLOG("Waiting for next pre command\n"); pthread_mutex_lock(&client->bits.localsock.mutex); -- 2.43.5