Send Linux-ha-cvs mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."
Today's Topics:
1. Linux-HA CVS: lib by alan from ([email protected])
2. Linux-HA CVS: lib by alan from ([email protected])
3. Linux-HA CVS: crm by andrew from
([email protected])
4. Linux-HA CVS: lrm by alan from ([email protected])
----------------------------------------------------------------------
Message: 1
Date: Fri, 3 Feb 2006 08:27:31 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by alan from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : alan
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/clplumbing
Modified Files:
longclock.c
Log Message:
Put in some new code to ignore a small SMP times(2) bug.
Put in better detection of improbable clock jumps.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/clplumbing/longclock.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- longclock.c 3 Feb 2006 14:08:49 -0000 1.16
+++ longclock.c 3 Feb 2006 15:27:30 -0000 1.17
@@ -1,4 +1,4 @@
-/* $Id: longclock.c,v 1.16 2006/02/03 14:08:49 alan Exp $ */
+/* $Id: longclock.c,v 1.17 2006/02/03 15:27:30 alan Exp $ */
/*
* Longclock operations
*
@@ -76,7 +76,8 @@
#define BITSPERBYTE 8
#define WRAPSHIFT (BITSPERBYTE*sizeof(clock_t))
#define MAXIMUMULONG ((unsigned long)~(0UL))
-#define ENDTIMES ((MAXIMUMULONG/100UL)*95UL)
+#define ENDTIMES ((MAXIMUMULONG/100UL)*99UL)
+#define NEWERA (MAXIMUMULONG/100UL)
longclock_t
time_longclock(void)
@@ -87,33 +88,40 @@
static longclock_t lc_wrapcount = 0L;
static unsigned long callcount = 0L;
unsigned long timesval;
-
-
+
++callcount;
/*
* times(2) really returns an unsigned value ...
*
* We don't check to see if we got back the error value (-1), because
* the only possibility for an error would be if the address of
- * longclock_dummy_tms_struct was invalid. Since it's a
compiler-generated
- * address, we assume that errors are impossible. And, unfortunately,
it is
- * quite possible for the correct return from times(2) to be exactly
- * (clock_t)-1. Sigh...
+ * longclock_dummy_tms_struct was invalid. Since it's a
+ * compiler-generated address, we assume that errors are impossible.
+ * And, unfortunately, it is quite possible for the correct return
+ * from times(2) to be exactly (clock_t)-1. Sigh...
*
*/
timesval = (unsigned long) times(&longclock_dummy_tms_struct);
if (calledbefore && timesval < lasttimes) {
- ++wrapcount;
- lc_wrapcount = ((longclock_t)wrapcount) << WRAPSHIFT;
- if (lasttimes < (unsigned long)ENDTIMES) {
- /* This means it jumped by an improbably long amount...
*/
- cl_log(LOG_CRIT
- , "%s: clock_t from times(2) appears to have
jumped backwards!"
- , __FUNCTION__);
- cl_log(LOG_CRIT
- , "%s: old value was %lu, new value is %lu,
callcount %lu"
- , __FUNCTION__, lasttimes, timesval, callcount);
+ if ((lasttimes - timesval) <= 2UL) {
+ /* Some kind of (SMP) kernel weirdness */
+ timesval = lasttimes;
+ }else{
+ ++wrapcount;
+ lc_wrapcount = ((longclock_t)wrapcount) << WRAPSHIFT;
+ if (lasttimes < ENDTIMES || timesval >= NEWERA) {
+ /* Clock jumped a long way(!) */
+ cl_log(LOG_CRIT
+ , "%s: clock_t from times(2) appears to"
+ " have jumped backwards!"
+ , __FUNCTION__);
+ cl_log(LOG_CRIT
+ , "%s: old value was %lu"
+ ", new value is %lu, callcount %lu"
+ , __FUNCTION__, lasttimes, timesval
+ , callcount);
+ }
}
}
lasttimes = timesval;
------------------------------
Message: 2
Date: Fri, 3 Feb 2006 08:47:17 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by alan from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : alan
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/clplumbing
Modified Files:
longclock.c
Log Message:
Put in a special message to print out an annoying condition where the
kernel jumps back the times(2) clock a single tick on certain SMP machines.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/clplumbing/longclock.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- longclock.c 3 Feb 2006 15:27:30 -0000 1.17
+++ longclock.c 3 Feb 2006 15:47:17 -0000 1.18
@@ -1,4 +1,4 @@
-/* $Id: longclock.c,v 1.17 2006/02/03 15:27:30 alan Exp $ */
+/* $Id: longclock.c,v 1.18 2006/02/03 15:47:17 alan Exp $ */
/*
* Longclock operations
*
@@ -106,6 +106,14 @@
if (calledbefore && timesval < lasttimes) {
if ((lasttimes - timesval) <= 2UL) {
/* Some kind of (SMP) kernel weirdness */
+ cl_log(LOG_CRIT
+ , "%s: clock_t from times(2) appears to"
+ " have jumped backwards just a few ticks!"
+ , __FUNCTION__);
+ cl_log(LOG_CRIT
+ , "%s: old value was %lu"
+ ", new value is %lu, callcount %lu"
+ , __FUNCTION__, lasttimes, timesval, callcount);
timesval = lasttimes;
}else{
++wrapcount;
------------------------------
Message: 3
Date: Fri, 3 Feb 2006 08:52:04 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/crmd
Modified Files:
messages.c
Log Message:
Forgot this file in the last commit
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/messages.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -3 -r1.142 -r1.143
--- messages.c 17 Jan 2006 13:24:24 -0000 1.142
+++ messages.c 3 Feb 2006 15:52:04 -0000 1.143
@@ -690,7 +690,7 @@
fsa_input_register);
crm_warn("Client %s joined but we dont need it",
client_name);
- stop_subsystem(the_subsystem);
+ stop_subsystem(the_subsystem, TRUE);
} else {
the_subsystem->ipc =
------------------------------
Message: 4
Date: Fri, 3 Feb 2006 09:38:08 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lrm by alan from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : alan
Host :
Project : linux-ha
Module : lrm
Dir : linux-ha/lrm/lrmd
Modified Files:
lrmd.c
Log Message:
Made a minor fix to make sure we don't try and destroy a timer multiple times.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lrm/lrmd/lrmd.c,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -3 -r1.203 -r1.204
--- lrmd.c 2 Feb 2006 17:47:07 -0000 1.203
+++ lrmd.c 3 Feb 2006 16:38:07 -0000 1.204
@@ -1,4 +1,4 @@
-/* $Id: lrmd.c,v 1.203 2006/02/02 17:47:07 alan Exp $ */
+/* $Id: lrmd.c,v 1.204 2006/02/03 16:38:07 alan Exp $ */
/*
* Local Resource Manager Daemon
*
@@ -350,7 +350,6 @@
static int init_start(void);
static int init_stop(const char *pid_file);
static int init_status(const char *pid_file, const char *client_name);
-static lrmd_op_t* lrmd_op_copy(const lrmd_op_t* op);
static void lrmd_rsc_dump(char* rsc_id, const char * text);
static struct {
@@ -492,6 +491,14 @@
}
/* Do a "shallow" copy */
*ret = *op;
+ /*
+ * Some things, like timer ids and child pids are duplicated here
+ * but can be destroyed in one copy, but kept intact
+ * in the other, to later be destroyed.
+ * This isn't a complete disaster, since the timer ids aren't
+ * pointers, but it's still untidy at the least.
+ * Be sure and care of this situation when using this function.
+ */
/* Do a "deep" copy of the message structure */
ret->msg = ha_msg_copy(op->msg);
ret->rsc_id = cl_strdup(op->rsc_id);
@@ -2365,7 +2372,7 @@
*/
ha_msg_del(op->msg);
op->msg = NULL;
- if (op->rsc_id !=NULL ) {
+ if (op->rsc_id != NULL ) {
cl_free(op->rsc_id);
op->rsc_id = NULL;
}
@@ -2554,9 +2561,12 @@
g_hash_table_replace(client_last_op
, cl_strdup(op_type)
, (gpointer)new_op);
+ /* Don't let the timers go away */
lrmd_op_destroy(old_op);
- }
- else {
+ }else{
+ new_op->timeout_tag = (guint)-1;
+ new_op->repeat_timeout_tag = (guint)-1;
+ new_op->exec_pid = -1;
g_hash_table_insert(client_last_op
, cl_strdup(op_type)
, (gpointer)new_op);
@@ -3471,6 +3481,9 @@
}
/*
* $Log: lrmd.c,v $
+ * Revision 1.204 2006/02/03 16:38:07 alan
+ * Made a minor fix to make sure we don't try and destroy a timer multiple
times.
+ *
* Revision 1.203 2006/02/02 17:47:07 alan
* Fixed some cast errors in reference timer tags.
*
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 27, Issue 22
********************************************