[Ocfs2-commits] mfasheh commits r2541 - trunk/fs/ocfs2/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Aug 23 16:31:55 CDT 2005
Author: mfasheh
Signed-off-by: manish
Date: 2005-08-23 16:31:54 -0500 (Tue, 23 Aug 2005)
New Revision: 2541
Modified:
trunk/fs/ocfs2/cluster/heartbeat.c
Log:
* Allow time to move backward when calculating heartbeat thread intervals.
Signed-off-by: manish
Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c 2005-08-23 07:09:35 UTC (rev 2540)
+++ trunk/fs/ocfs2/cluster/heartbeat.c 2005-08-23 21:31:54 UTC (rev 2541)
@@ -856,8 +856,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