[Linux-HA] [patch] clock_t wrapped around causingfalse resourcestart failure

Dejan Muhamedagic dejanmm at fastmail.fm
Wed Jul 1 08:59:24 MDT 2009

Hi Lars,

On Wed, Jul 01, 2009 at 04:44:06PM +0200, Lars Ellenberg wrote:
> On Wed, Jul 01, 2009 at 10:22:58AM -0400, Tavanyar, Simon wrote:
> > Aahh ... so it's measured after reboot. That makes sense.
> > Thanks, Lars.
> > 
> > Should I wait for you to log a bugzilla on this?
> bugzilla and me don't go along very well, really ;-)
> so please feel free to open that bugzilla,
> and attach my proposed patch there.
> just to reiterate:
> the problem is not the uptime wrap or resulting longclock wrap,
> as that is handled correctly in cl_times() and time_longclock.
> but the cmp_longclock comparing unsigned values
> without checking for wrap.

The wrap is stuffed into upper bits of the longclock_t variables:

    return (lc_wrapcount | (longclock_t)timesval);

Or am I missing something? The only explanation I can think of is
that this is actually wrong:

    if (cmp_longclock(lnow, append->nexttime) >= 0) {

i.e. it should be strictly greater. I guess that what happened is
that somehow the prepare function got called fast enough, so that
both timestamps ended equal.



> -- 
> : Lars Ellenberg
> : LINBIT | Your Way to High Availability
> : DRBD/HA support and consulting http://www.linbit.com
> DRBD? and LINBIT? are registered trademarks of LINBIT, Austria.
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems

More information about the Linux-HA mailing list