[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CANn89iLJ+LHK2oMAwWiifg1pa=t2JBi7N6794ixe4aSB_vvuJA@mail.gmail.com>
Date: Thu, 12 Jul 2018 05:35:56 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: David Laight <David.Laight@...lab.com>
Cc: jmaxwell37@...il.com, David Miller <davem@...emloft.net>,
Neal Cardwell <ncardwell@...gle.com>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
netdev <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>, jmaxwell@...hat.com
Subject: Re: [net-next, 1/3] tcp: convert icsk_user_timeout from jiffies to msecs
On Thu, Jul 12, 2018 at 1:57 AM David Laight <David.Laight@...lab.com> wrote:
>
> From: Jon Maxwell Sent: 12 July 2018 01:36
> ...
> > - (s32)(tcp_time_stamp(tp) - start_ts) >
> > - jiffies_to_msecs(icsk->icsk_user_timeout))
> > + (s32)(tcp_time_stamp(tp) - start_ts) > icsk->icsk_user_timeout)
>
> That has never been tested properly.
> icsk_user_timeout is u32 so the comparison is unsigned and the (s32) cast
> has no effect.
>
The existing code had this ' bug' already.
Please do not blame this patch, and send a patch if you believe there
is an issue ?
In my opinion, the (s32) here is a reminder for the reader of the
width of the expression,
more than anything, since there is no chance the result can be negative.
Powered by blists - more mailing lists