master - clvmd: move call of cluster_closedown
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c45cd6eb8d0272...
Commit: c45cd6eb8d0272b6700d0b0c6f2baa82fe67f37d
Parent: fc39ad677b3f4ffe8d4bba975e1628fb8f141921
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 21 21:19:54 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 21 22:29:23 2014 +0100
clvmd: move call of cluster_closedown
We have to close cluster in some predicatable way,
otherwise we may access released memory from different
threads.
So move closedown till the point we know all thread
are closed. New messages from cluster are discarded.
---
daemons/clvmd/clvmd.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index 4f6a6df..3890347 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -636,6 +636,8 @@ int main(int argc, char *argv[])
dm_free(delfd);
}
+ clops->cluster_closedown();
+
ret = 0;
out:
dm_hash_destroy(lvm_params.excl_uuid);
@@ -957,7 +959,6 @@ static void main_loop(int local_sock, int cmd_timeout)
}
closedown:
- clops->cluster_closedown();
if (quit)
DEBUGLOG("SIGTERM received\n");
}
9 years, 6 months
master - clvmd: move destroy_lvm into lvm thread
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fc39ad677b3f4f...
Commit: fc39ad677b3f4ffe8d4bba975e1628fb8f141921
Parent: 8431d47b3b4d1742e9703a1abfd9722b94adaf34
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 20 14:23:03 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 21 22:29:23 2014 +0100
clvmd: move destroy_lvm into lvm thread
Since lvm was initialized in lvm thread call destroy there as well.
---
daemons/clvmd/clvmd.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index 4ca2918..4f6a6df 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -625,7 +625,6 @@ int main(int argc, char *argv[])
log_sys_error("pthread_join", "");
close_local_sock(local_sock);
- destroy_lvm();
while ((delfd = local_client_head.next)) {
local_client_head.next = delfd->next;
@@ -2102,6 +2101,8 @@ static void *lvm_thread_fn(void *arg)
pthread_mutex_unlock(&lvm_thread_mutex);
+ destroy_lvm();
+
pthread_exit(NULL);
}
9 years, 6 months
master - clvmd: add special lvm thread exit
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8431d47b3b4d17...
Commit: 8431d47b3b4d1742e9703a1abfd9722b94adaf34
Parent: 05a532e1711e9e5e03dc879b790a92fb2a2464c8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 21 18:01:38 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 21 22:29:23 2014 +0100
clvmd: add special lvm thread exit
When multiple threads act on the same 'quit' variable
the order of exit becomes unpredictable.
So let the main_loop() finish first and then clean up
all queued lvm jobs.
Do not add any new work, when lvm_thread_exit is set.
---
daemons/clvmd/clvmd.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index a3f4354..4ca2918 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -89,6 +89,7 @@ static pthread_t lvm_thread;
/* Stack size 128KiB for thread, must be bigger then DEFAULT_RESERVED_STACK */
static const size_t STACK_SIZE = 128 * 1024;
static pthread_attr_t stack_attr;
+static int lvm_thread_exit = 0;
static pthread_mutex_t lvm_thread_mutex;
static pthread_cond_t lvm_thread_cond;
static pthread_barrier_t lvm_start_barrier;
@@ -617,6 +618,7 @@ int main(int argc, char *argv[])
main_loop(local_sock, cmd_timeout);
pthread_mutex_lock(&lvm_thread_mutex);
+ lvm_thread_exit = 1;
pthread_cond_signal(&lvm_thread_cond);
pthread_mutex_unlock(&lvm_thread_mutex);
if ((errno = pthread_join(lvm_thread, NULL)))
@@ -2081,7 +2083,7 @@ static void *lvm_thread_fn(void *arg)
/* Now wait for some actual work */
pthread_mutex_lock(&lvm_thread_mutex);
- while (!quit) {
+ while (!lvm_thread_exit)
if (dm_list_empty(&lvm_cmd_head)) {
DEBUGLOG("LVM thread waiting for work\n");
pthread_cond_wait(&lvm_thread_cond, &lvm_thread_mutex);
@@ -2097,7 +2099,6 @@ static void *lvm_thread_fn(void *arg)
pthread_mutex_lock(&lvm_thread_mutex);
}
- }
pthread_mutex_unlock(&lvm_thread_mutex);
@@ -2110,6 +2111,9 @@ static int add_to_lvmqueue(struct local_client *client, struct clvm_header *msg,
{
struct lvm_thread_cmd *cmd;
+ if (lvm_thread_exit)
+ return -1; /* We are about to exit */
+
cmd = malloc(sizeof(struct lvm_thread_cmd));
if (!cmd)
return ENOMEM;
9 years, 6 months
master - clvmd: always set cleanup_needed
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=05a532e1711e9e...
Commit: 05a532e1711e9e5e03dc879b790a92fb2a2464c8
Parent: 5bea2b5c8208db7c0277d7bd8672a4db26fbf6d6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 21 11:46:50 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 21 22:29:23 2014 +0100
clvmd: always set cleanup_needed
When thread is created, set the cleanup_needed flag
immediately so it could be used properly any time later
when cleanup_zombie() is needed.
---
daemons/clvmd/clvmd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index 00945da..a3f4354 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -1261,7 +1261,6 @@ static int read_from_local_sock(struct local_client *thisfd)
/* EOF or error on socket */
if (len <= 0) {
- thisfd->bits.localsock.cleanup_needed = 1;
cleanup_zombie(thisfd); /* we ignore errors here */
return 0;
} else {
@@ -1457,6 +1456,7 @@ static int read_from_local_sock(struct local_client *thisfd)
/* Run the pre routine */
thisfd->bits.localsock.in_progress = TRUE;
thisfd->bits.localsock.state = PRE_COMMAND;
+ thisfd->bits.localsock.cleanup_needed = 1;
DEBUGLOG("Creating pre&post thread\n");
status = pthread_create(&thisfd->bits.localsock.threadid,
&stack_attr, pre_and_post_thread, thisfd);
9 years, 6 months
master - clvmd: fix clean memory on exit
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5bea2b5c8208db...
Commit: 5bea2b5c8208db7c0277d7bd8672a4db26fbf6d6
Parent: 486b15d36ce672f78a35143ce6bb12c48552fbf8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 21 17:07:57 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 21 22:29:22 2014 +0100
clvmd: fix clean memory on exit
Properly clean 'client' structure only for LOCAL_SOCK type.
(Fixes bug from commit 460c19df621d35260caceec7f598da1566263cd4)
(in release fix)
Also cleanup-up associated pthreads by using cleanup_zombie() function.
Since this function may change the list, restart scanning always from
the list header.
Note: couple following patches are necessary to make this working properly.
---
daemons/clvmd/clvmd.c | 19 +++++++------------
1 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index ddebc15..00945da 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -625,18 +625,13 @@ int main(int argc, char *argv[])
close_local_sock(local_sock);
destroy_lvm();
- for (newfd = local_client_head.next; newfd != NULL;) {
- delfd = newfd;
- newfd = newfd->next;
- if (delfd->fd == local_sock)
- delfd->fd = -1;
- /*
- * FIXME:
- * needs cleanup code from read_from_local_sock() for now
- * break of 'clvmd' may access already free memory here.
- */
- safe_close(&(delfd->fd));
- cmd_client_cleanup(delfd);
+ while ((delfd = local_client_head.next)) {
+ local_client_head.next = delfd->next;
+ /* Failing cleanup_zombie leaks... */
+ if (delfd->type == LOCAL_SOCK && !cleanup_zombie(delfd))
+ cmd_client_cleanup(delfd); /* calls sync_unlock */
+ if (delfd->fd != local_sock)
+ safe_close(&(delfd->fd));
dm_free(delfd);
}
9 years, 6 months
master - memlock: drop locked mem in critical section
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=486b15d36ce672...
Commit: 486b15d36ce672f78a35143ce6bb12c48552fbf8
Parent: 0ca16c694668ded9b33c22dc54316dd4bd77151b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 20 13:53:39 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 21 22:29:22 2014 +0100
memlock: drop locked mem in critical section
When daemon releases memory and it is still in critical
section, issue an error message and drop memory.
We cannot do anything better for now and we at least
release allocated resource.
FIXME:
This code is triggered when i.e. clvmd is killed while
some LVs are suspend - in this case suspended devices leak,
so if this happens during i.e. clvmd upgrade we have
unresolved problem - even locked rootfs...
---
lib/mm/memlock.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
index f32424a2..a83c3ed 100644
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
@@ -456,6 +456,11 @@ void memlock_dec_daemon(struct cmd_context *cmd)
log_error(INTERNAL_ERROR "_memlock_count_daemon has dropped below 0.");
--_memlock_count_daemon;
log_debug_mem("memlock_count_daemon dec to %d", _memlock_count_daemon);
+ if (!_memlock_count_daemon && _critical_section && _mem_locked) {
+ log_error("Unlocking daemon memory in critical section.");
+ _unlock_mem(cmd);
+ _mem_locked = 0;
+ }
_unlock_mem_if_possible(cmd);
}
9 years, 6 months
master - activate: report release with critical section
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0ca16c694668de...
Commit: 0ca16c694668ded9b33c22dc54316dd4bd77151b
Parent: e5382c063d2549d3a28b3182218b7978e0c22442
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 20 10:31:21 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 21 22:29:22 2014 +0100
activate: report release with critical section
This function is typically called for cmd context refresh or destroy.
On the non-clustered case we already unlocked all messages,
however when i.e. 'clvmd' gets break signal it may have
still couple messages queued.
For now just report an error.
---
lib/activate/activate.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 565634f..9d404e5 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -2348,11 +2348,16 @@ int pv_uses_vg(struct physical_volume *pv,
void activation_release(void)
{
- dev_manager_release();
+ if (critical_section())
+ /* May leak stacked operation */
+ log_error("Releasing activation in critical section.");
+
+ fs_unlock(); /* Implicit dev_manager_release(); */
}
void activation_exit(void)
{
+ activation_release();
dev_manager_exit();
}
#endif
9 years, 6 months
master - lvmcache: fix debug trace
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e5382c063d2549...
Commit: e5382c063d2549d3a28b3182218b7978e0c22442
Parent: fc280bcc42556ca1c78d897839d05b3688d9d65b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 19 23:35:36 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 21 22:29:22 2014 +0100
lvmcache: fix debug trace
Recent debug tracing commit introduce read of uninitialized memory,
since VGID is not really a proper string which ends with '\0'.
Enforce at most 32 (ID_LEN) chars are read from vgid.
(in release fix)
---
lib/cache/lvmcache.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 0c49ccf..c61bb77 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -446,8 +446,8 @@ struct lvmcache_vginfo *lvmcache_vginfo_from_vgname(const char *vgname, const ch
while ((vginfo = vginfo->next));
if (!vginfo)
- log_debug_cache("Metadata cache has not found vgname \"%s\" with vgid \"%s\"",
- vgname, vgid);
+ log_debug_cache("Metadata cache has not found vgname \"%s\" with vgid \"%."
+ DM_TO_STRING(ID_LEN) "s\".", vgname, vgid ? : "");
return vginfo;
}
9 years, 6 months
master - lvmcache: handle reinit without error
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fc280bcc42556c...
Commit: fc280bcc42556ca1c78d897839d05b3688d9d65b
Parent: bdd7baeab39f7ef61817b2c48008852aefdbcdb0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 21 22:26:39 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 21 22:29:21 2014 +0100
lvmcache: handle reinit without error
Since commit f12ee43f2eaba5d38b1925a5a34b1746c1d66985 call destroy,
it start to check all VGs are unlocked. However when we become_daemon,
we simply reset locking (since lock is still kept by parent process).
So implement a simple 'reset' flag.
---
lib/cache/lvmcache.c | 9 ++++++---
lib/cache/lvmcache.h | 2 +-
lib/commands/toolcontext.c | 4 ++--
tools/lvmcmdline.c | 2 +-
tools/pvscan.c | 2 +-
tools/toollib.c | 2 +-
tools/vgrename.c | 2 +-
tools/vgscan.c | 2 +-
8 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index f414aed..0c49ccf 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1621,7 +1621,7 @@ static void _lvmcache_destroy_lockname(struct dm_hash_node *n)
dm_hash_get_key(_lock_hash, n));
}
-void lvmcache_destroy(struct cmd_context *cmd, int retain_orphans)
+void lvmcache_destroy(struct cmd_context *cmd, int retain_orphans, int reset)
{
struct dm_hash_node *n;
log_verbose("Wiping internal VG cache");
@@ -1647,8 +1647,11 @@ void lvmcache_destroy(struct cmd_context *cmd, int retain_orphans)
}
if (_lock_hash) {
- dm_hash_iterate(n, _lock_hash)
- _lvmcache_destroy_lockname(n);
+ if (reset)
+ _vg_global_lock_held = 0;
+ else
+ dm_hash_iterate(n, _lock_hash)
+ _lvmcache_destroy_lockname(n);
dm_hash_destroy(_lock_hash);
_lock_hash = NULL;
}
diff --git a/lib/cache/lvmcache.h b/lib/cache/lvmcache.h
index bf26664..83d561b 100644
--- a/lib/cache/lvmcache.h
+++ b/lib/cache/lvmcache.h
@@ -42,7 +42,7 @@ struct lvmcache_vginfo;
int lvmcache_init(void);
void lvmcache_allow_reads_with_lvmetad(void);
-void lvmcache_destroy(struct cmd_context *cmd, int retain_orphans);
+void lvmcache_destroy(struct cmd_context *cmd, int retain_orphans, int reset);
/* Set full_scan to 1 to reread every filtered device label or
* 2 to rescan /dev for new devices */
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 899666c..f0c0201 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -1596,7 +1596,7 @@ int refresh_toolcontext(struct cmd_context *cmd)
*/
activation_release();
- lvmcache_destroy(cmd, 0);
+ lvmcache_destroy(cmd, 0, 0);
label_exit();
_destroy_segtypes(&cmd->segtypes);
_destroy_formats(cmd, &cmd->formats);
@@ -1688,7 +1688,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
archive_exit(cmd);
backup_exit(cmd);
- lvmcache_destroy(cmd, 0);
+ lvmcache_destroy(cmd, 0, 0);
label_exit();
_destroy_segtypes(&cmd->segtypes);
_destroy_formats(cmd, &cmd->formats);
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 454bee8..b7d69ef 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1185,7 +1185,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
out:
if (test_mode()) {
log_verbose("Test mode: Wiping internal cache");
- lvmcache_destroy(cmd, 1);
+ lvmcache_destroy(cmd, 1, 0);
}
if ((old_cft = remove_config_tree_by_source(cmd, CONFIG_STRING))) {
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 6a74ac0..9e5536e 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -363,7 +363,7 @@ int pvscan(struct cmd_context *cmd, int argc, char **argv)
if (cmd->filter->wipe)
cmd->filter->wipe(cmd->filter);
- lvmcache_destroy(cmd, 1);
+ lvmcache_destroy(cmd, 1, 0);
/* populate lvmcache */
if (!lvmetad_vg_list_to_lvmcache(cmd))
diff --git a/tools/toollib.c b/tools/toollib.c
index 2bc0be3..6b68f55 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -91,8 +91,8 @@ int become_daemon(struct cmd_context *cmd, int skip_lvm)
strncpy(*cmd->argv, "(lvm2)", strlen(*cmd->argv));
if (!skip_lvm) {
- lvmcache_destroy(cmd, 1);
reset_locking();
+ lvmcache_destroy(cmd, 1, 1);
if (!lvmcache_init())
/* FIXME Clean up properly here */
_exit(ECMD_FAILED);
diff --git a/tools/vgrename.c b/tools/vgrename.c
index b5e778f..d97b871 100644
--- a/tools/vgrename.c
+++ b/tools/vgrename.c
@@ -185,7 +185,7 @@ static int vg_rename_path(struct cmd_context *cmd, const char *old_vg_path,
/* FIXME lvmcache corruption - vginfo duplicated instead of renamed */
if (cmd->filter->wipe)
cmd->filter->wipe(cmd->filter);
- lvmcache_destroy(cmd, 1);
+ lvmcache_destroy(cmd, 1, 0);
return 1;
diff --git a/tools/vgscan.c b/tools/vgscan.c
index baf25b0..fff0e89 100644
--- a/tools/vgscan.c
+++ b/tools/vgscan.c
@@ -44,7 +44,7 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv)
if (cmd->filter->wipe)
cmd->filter->wipe(cmd->filter);
- lvmcache_destroy(cmd, 1);
+ lvmcache_destroy(cmd, 1, 0);
if (arg_count(cmd, cache_ARG)) {
if (lvmetad_active()) {
9 years, 6 months
master - cmirrord: Clean-up stray warning message (attempt #2)
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bdd7baeab39f7e...
Commit: bdd7baeab39f7ef61817b2c48008852aefdbcdb0
Parent: f12ee43f2eaba5d38b1925a5a34b1746c1d66985
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Mar 19 14:43:00 2014 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Mar 19 14:43:00 2014 -0500
cmirrord: Clean-up stray warning message (attempt #2)
There are two types of CPG communications in a corosync cluster:
messages and state transitions. Cmirrord processes the state
transitions first.
When a cluster mirror issues a POSTSUSPEND, it signals the end of
cluster communication with the rest of the nodes in the cluster.
The POSTSUSPEND marks the last communication of the 'message'
type that will go around the cluster. The node then calls
cpg_leave which causes a final 'state transition' communication to
all of the nodes. Once the out-going node receives its own state
transition notice from the cluster, it finalizes the leave. At this
point, the state of the log is 'INVALID'; but it is possible that
there remains some cluster trafic that was queued up behind the
state transition that still wants to be processed. It is harmless
to attempt to dispatch any remaining messages - they won't be
delivered because the node is no longer in the cluster. However,
there was a warning message that was being printed in this case
that is now removed by this patch. The failure of the dispatch
created a false positive condition that triggered the message.
---
daemons/cmirrord/cluster.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/daemons/cmirrord/cluster.c b/daemons/cmirrord/cluster.c
index 67391f1..3fd5d23 100644
--- a/daemons/cmirrord/cluster.c
+++ b/daemons/cmirrord/cluster.c
@@ -985,9 +985,9 @@ static int do_cluster_work(void *data __attribute__((unused)))
dm_list_iterate_items_safe(entry, tmp, &clog_cpg_list) {
r = cpg_dispatch(entry->handle, CS_DISPATCH_ALL);
if (r != CS_OK) {
- if ((entry->cpg_state == INVALID) &&
- (entry->state == LEAVING) &&
- (r == CS_ERR_BAD_HANDLE))
+ if ((r == CS_ERR_BAD_HANDLE) &&
+ ((entry->state == INVALID) ||
+ (entry->state == LEAVING)))
/* It's ok if we've left the cluster */
r = CS_OK;
else
9 years, 6 months