Re: Wireless IBSS on Linux-2.6.34 broken by commit3bbb9ec946428b96657126768f65487a48dd090c

From: Thomas Gleixner
Date: Tue May 25 2010 - 14:39:09 EST


On Mon, 24 May 2010, Linus Torvalds wrote:
>
> On Mon, 24 May 2010, Jeff Chua wrote:
> >
> > - expires_limit = expires + timer->slack;
> > + expires_limit = expires;
> >
> > - if (timer->slack < 0) /* auto slack: use 0.4% */
> > + if (timer->slack > -1)
> > + expires_limit = expires + timer->slack;
> > + else if (time_after(expires, jiffies)) /* auto slack: use 0.4% */
> > expires_limit = expires + (expires - jiffies)/256;
>
> Please don't reload 'jiffies' twice. It's volatile, and the compiler will
> do a crap job of it.

Grr, it's even worse. If jiffies increment between the time_after()
check and (expires - jiffies) we might run into the same problem as
before. Sigh, did not notice when I picked it up. ENOTENOUGHCOFFEE.

> Also, '0' is a normal number, but '-1' is a rather odd value. Please just
> test for non-negative by doing ">= 0" rather than "> -1"

Will fix, thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/