cluster: RHEL55 - rgmanager: Fix bad assertion

Lon Hohberger lon at fedoraproject.org
Wed Oct 21 19:56:18 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=25155283f4797f85fa30b95c94c8ebb7df07dcc3
Commit:        25155283f4797f85fa30b95c94c8ebb7df07dcc3
Parent:        5c328396a61fd828c939fa3eea25b763093d0ba1
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:45:03 2009 -0400

rgmanager: Fix bad assertion

rhbz#506094

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 d93921b..900debe 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -1431,8 +1431,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