[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/rgmanager ChangeLog src/daemons/restre ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	lhh sourceware org	2006-11-03 16:26:19

Modified files:
	rgmanager      : ChangeLog 
	rgmanager/src/daemons: restree.c rg_thread.c 
	rgmanager/src/resources: fs.sh 

Log message:
	Fix #213246 (Patch by Jeff Layton), #213312

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/ChangeLog.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5.2.23&r2=1.5.2.24
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/restree.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.10.2.12&r2=1.10.2.13
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/rg_thread.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.7.2.6&r2=1.7.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/fs.sh.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.4.2.17&r2=1.4.2.18

--- cluster/rgmanager/ChangeLog	2006/10/05 17:52:27	1.5.2.23
+++ cluster/rgmanager/ChangeLog	2006/11/03 16:26:18	1.5.2.24
@@ -1,3 +1,9 @@
+2006-11-03 Lon Hohberger <lhh at redhat.com>
+	* src/daemons/restree.c: Merge patch from Jeff Layton to instrument
+	res_exec more closely. (#213246)
+	* src/daemons/rg_thread.c: Fix segfault caused by improper loop 
+	semantics (#213312)
+
 2006-10-05 Lon Hohberger <lhh at redhat.com>
 	* src/clulib/clulog.c: Change stdout/stderr to nonblocking (#207144
 	part 1)
--- cluster/rgmanager/src/daemons/restree.c	2006/09/21 18:03:30	1.10.2.12
+++ cluster/rgmanager/src/daemons/restree.c	2006/11/03 16:26:18	1.10.2.13
@@ -340,18 +340,30 @@
 	resource_t *res = node->rn_resource;
 	char fullpath[2048];
 
-	if (!res->r_rule->rr_agent)
+	if (!res->r_rule->rr_agent) {
+		clulog(LOG_DEBUG,
+		       "%s on %s \"%s\" no rr_agent\n",
+		       res_ops[op], res->r_rule->rr_type,
+		       res->r_attrs->ra_value);
 		return 0;
+	}
 
 #ifdef DEBUG
 	env = build_env(node, op);
-	if (!env)
+	if (!env) {
+		clulog(LOG_DEBUG,
+		       "%s on %s \"%s\" build_env failed %d\n",
+		       res_ops[op], res->r_rule->rr_type,
+		       res->r_attrs->ra_value, errno);
 		return -errno;
+	}
 #endif
 
 	childpid = fork();
-	if (childpid < 0)
+	if (childpid < 0) {
+		clulog(LOG_ERR, "%s: fork failed (%d)!\n", __func__, errno);
 		return -errno;
+	}
 
 	if (!childpid) {
 		/* Child */ 
@@ -368,8 +380,13 @@
 		env = build_env(node, op, depth);
 #endif
 
-		if (!env)
+		if (!env) {
+			clulog(LOG_DEBUG,
+		       		"%s on %s \"%s\" build_env failed (ENOMEM)\n",
+		       		res_ops[op], res->r_rule->rr_type,
+		       		res->r_attrs->ra_value);
 			exit(-ENOMEM);
+		}
 
 		if (res->r_rule->rr_agent[0] != '/')
 			snprintf(fullpath, sizeof(fullpath), "%s/%s",
@@ -399,7 +416,13 @@
 
 		if (ret) {
 			clulog(LOG_NOTICE,
-			       "%s on %s \"%s\" returned %d (%s)\n",
+			       "%s on %s:%s returned %d (%s)\n",
+			       res_ops[op], res->r_rule->rr_type,
+			       res->r_attrs->ra_value, ret,
+			       ocf_strerror(ret));
+		} else {
+			clulog(LOG_DEBUG,
+			       "%s on %s:%s returned %d (%s)\n",
 			       res_ops[op], res->r_rule->rr_type,
 			       res->r_attrs->ra_value, ret,
 			       ocf_strerror(ret));
@@ -411,6 +434,11 @@
 	if (!WIFSIGNALED(ret))
 		assert(0);
 
+	clulog(LOG_ERR,
+	       "%s on %s:%s caught signal %d\n",
+	       res_ops[op], res->r_rule->rr_type,
+	       res->r_attrs->ra_value, WTERMSIG(ret));
+
 	return -EFAULT;
 }
 
--- cluster/rgmanager/src/daemons/rg_thread.c	2006/05/12 21:28:31	1.7.2.6
+++ cluster/rgmanager/src/daemons/rg_thread.c	2006/11/03 16:26:18	1.7.2.7
@@ -110,18 +110,22 @@
 purge_status_checks(request_t **list)
 {
 	request_t *curr;
+	int found;
 	
 	if (!list)
 		return;
 
-	list_do(list, curr) {
-		if (curr->rr_request != RG_STATUS)
-			continue;
-
-		list_remove(list, curr);
-		rq_free(curr);
-		curr = *list;
-	} while (!list_done(list, curr));
+	do {
+		found = 0;
+		list_do(list, curr) {
+			if (curr->rr_request == RG_STATUS) {
+				list_remove(list, curr);
+				rq_free(curr);
+				found = 1;
+				break;
+			}
+		} while (!list_done(list, curr));
+	} while (found);
 }
 
 
--- cluster/rgmanager/src/resources/fs.sh	2006/10/20 20:34:25	1.4.2.17
+++ cluster/rgmanager/src/resources/fs.sh	2006/11/03 16:26:19	1.4.2.18
@@ -530,8 +530,8 @@
 			# place
 			#
 			if [ -n "$tmp_mp"  -a "$tmp_mp"  != "$mp" ]; then
-				ocf_log warn "\
-Device $dev is mounted on $tmp_mp instead of $mp"
+				ocf_log warn \
+"Device $dev is mounted on $tmp_mp instead of $mp"
 			fi
 			return $YES
 		fi
@@ -788,6 +788,7 @@
 enable_fs_quotas()
 {
 	declare -i need_check=0
+	declare -i rv
 	declare quotaopts=""
 	declare mopt
 	declare opts=$1
@@ -835,8 +836,13 @@
 	ocf_log info "Enabling Quotas on $mp"
 	ocf_log debug "quotaon -$quotaopts $mp"
 	quotaon -$quotaopts $mp
+	rv=$?
+	if [ $rv -ne 0 ]; then
+		# Just a warning
+		ocf_log warn "Unable to turn on quotas for $mp; return = $rv"
+	fi
 
-	return $?
+	return $rv
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]