cluster: STABLE3 - rgmanager: Fix bad assertion

Lon Hohberger lon at fedoraproject.org
Wed Oct 21 19:42:31 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=3dcc10f537594ef711d7e72d43256755bdae9cc1
Commit:        3dcc10f537594ef711d7e72d43256755bdae9cc1
Parent:        eeac060d98895dff7a87a372f9d6e24f0b5dee67
Author:        Lon Hohberger <lhh at redhat.com>
AuthorDate:    Wed Oct 21 15:42:10 2009 -0400
Committer:     Lon Hohberger <lhh at redhat.com>
CommitterDate: Wed Oct 21 15:42:10 2009 -0400

rgmanager: Fix bad assertion

Signed-off-by: Lon Hohberger <lhh at redhat.com>
---
 rgmanager/src/daemons/restree.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index 4ae0848..a4d2926 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -1376,8 +1376,9 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
 		   incarnations there are. */
 		pthread_mutex_lock(&node->rn_resource->r_mutex);
 		if (node->rn_state == RES_STARTED) {
-			assert(node->rn_resource->r_incarnations > 0);
-			--node->rn_resource->r_incarnations;
+			assert(node->rn_resource->r_incarnations >= 0);
+			if (node->rn_resource->r_incarnations > 0)
+				--node->rn_resource->r_incarnations;
 		}
 
 		node->rn_flags &= ~RF_NEEDSTOP;


More information about the cluster-commits mailing list