On Sun, Jul 22, 2018 at 12:29 AM Tariq Toukan <tar...@mellanox.com> wrote:
>
>
>
> On 19/07/2018 8:21 PM, Cong Wang wrote:
> > On Thu, Jul 19, 2018 at 7:50 AM Tariq Toukan <tar...@mellanox.com> wrote:
> >> --- a/net/core/dev_ioctl.c
> >> +++ b/net/core/dev_ioctl.c
> >> @@ -282,14 +282,7 @@ static int dev_ifsioc(struct net *net, struct ifreq 
> >> *ifr, unsigned int cmd)
> >>                  return dev_mc_del_global(dev, ifr->ifr_hwaddr.sa_data);
> >>
> >>          case SIOCSIFTXQLEN:
> >> -               if (ifr->ifr_qlen < 0)
> >> -                       return -EINVAL;
> >
> > Are you sure we can remove this if check too?
> >
> > The other one is safe to remove.
> >
>
> Hmm, let's see:
> dev_change_tx_queue_len gets unsigned long new_len, any negative value
> passed is interpreted as a very large number, then we test:
> if (new_len != (unsigned int)new_len)
>
> This test returns true if range of unsigned long is larger than range of
> unsigned int. AFAIK these ranges are Arch dependent and there is no
> guarantee this holds.
>

I am not sure either, you probably have to give it a test.
And at least, explain it in changelog if you still want to remove it.

Thanks.

Reply via email to