[Ocfs2-commits] mfasheh commits r2542 - branches/ocfs2-1.0/fs/ocfs2/cluster

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Aug 23 16:39:26 CDT 2005


Author: mfasheh
Signed-off-by: manish
Date: 2005-08-23 16:39:25 -0500 (Tue, 23 Aug 2005)
New Revision: 2542

Modified:
   branches/ocfs2-1.0/fs/ocfs2/cluster/heartbeat.c
Log:
* backport svn r2541:
    * Allow time to move backward when calculating heartbeat
      thread intervals.

Signed-off-by: manish



Modified: branches/ocfs2-1.0/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- branches/ocfs2-1.0/fs/ocfs2/cluster/heartbeat.c	2005-08-23 21:31:54 UTC (rev 2541)
+++ branches/ocfs2-1.0/fs/ocfs2/cluster/heartbeat.c	2005-08-23 21:39:25 UTC (rev 2542)
@@ -854,8 +854,13 @@
 static void o2hb_tv_subtract(struct timeval *a,
 			     struct timeval *b)
 {
-	BUG_ON(a->tv_sec < b->tv_sec);
-	BUG_ON(a->tv_sec == b->tv_sec && a->tv_usec < b->tv_usec);
+	/* just return 0 when a is after b */
+	if (a->tv_sec < b->tv_sec ||
+	    (a->tv_sec == b->tv_sec && a->tv_usec < b->tv_usec)) {
+		a->tv_sec = 0;
+		a->tv_usec = 0;
+		return;
+	}
 
 	a->tv_sec -= b->tv_sec;
 	a->tv_usec -= b->tv_usec;



More information about the Ocfs2-commits mailing list