[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20100906.131647.115921981.davem@davemloft.net>
Date: Mon, 06 Sep 2010 13:16:47 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: jdelvare@...e.de
Cc: eric.dumazet@...il.com, fubar@...ibm.com,
bonding-devel@...ts.sourceforge.net, netdev@...r.kernel.org,
jbohac@...e.cz
Subject: Re: [PATCH v2] bonding: Fix jiffies overflow problems (again)
From: Jean Delvare <jdelvare@...e.de>
Date: Thu, 2 Sep 2010 17:45:54 +0200
> From: Jiri Bohac <jbohac@...e.cz>
>
> The time_before_eq()/time_after_eq() functions operate on unsigned
> long and only work if the difference between the two compared values
> is smaller than half the range of unsigned long (31 bits on i386).
>
> Some of the variables (slave->jiffies, dev->trans_start, dev->last_rx)
> used by bonding store a copy of jiffies and may not be updated for a
> long time. With HZ=1000, time_before_eq()/time_after_eq() will start
> giving bad results after ~25 days.
>
> jiffies will never be before slave->jiffies, dev->trans_start,
> dev->last_rx by more than possibly a couple ticks caused by preemption
> of this code. This allows us to detect/prevent these overflows by
> replacing time_before_eq()/time_after_eq() with time_in_range().
>
> Signed-off-by: Jiri Bohac <jbohac@...e.cz>
> Signed-off-by: Jean Delvare <jdelvare@...e.de>
Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists