From: Cong Wang <xiyou.wangcong@gmail.com>
To: Tariq Toukan <tariqt@mellanox.com>
Cc: David Miller <davem@davemloft.net>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
eranbe@mellanox.com
Subject: Re: [PATCH net-next] net: remove redundant input checks in SIOCSIFTXQLEN case of dev_ifsioc
Date: Mon, 23 Jul 2018 13:37:22 -0700 [thread overview]
Message-ID: <CAM_iQpUo-Rp5OhbtLVGOG_HPYZYuPXeqVMZ3ip=VMUJ42Cg4PQ@mail.gmail.com> (raw)
In-Reply-To: <b75a52cb-2c7b-2108-f256-1ebb93a82f7b@mellanox.com>
On Sun, Jul 22, 2018 at 12:29 AM Tariq Toukan <tariqt@mellanox.com> wrote:
>
>
>
> On 19/07/2018 8:21 PM, Cong Wang wrote:
> > On Thu, Jul 19, 2018 at 7:50 AM Tariq Toukan <tariqt@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.
next prev parent reply other threads:[~2018-07-23 21:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 14:50 [PATCH net-next] net: remove redundant input checks in SIOCSIFTXQLEN case of dev_ifsioc Tariq Toukan
2018-07-19 17:21 ` Cong Wang
2018-07-22 7:29 ` Tariq Toukan
2018-07-23 20:37 ` Cong Wang [this message]
2018-07-23 21:00 ` David Miller
2018-07-24 8:35 ` Tariq Toukan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAM_iQpUo-Rp5OhbtLVGOG_HPYZYuPXeqVMZ3ip=VMUJ42Cg4PQ@mail.gmail.com' \
--to=xiyou.wangcong@gmail.com \
--cc=davem@davemloft.net \
--cc=eranbe@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=tariqt@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).