From: Wang Sheng-Hui <shhuiw@gmail.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dev_ioctl should return -EINVAL for unknown ioctl instead of -ENOTTY
Date: Fri, 02 Sep 2011 06:00:48 +0800 [thread overview]
Message-ID: <4E600090.5030505@gmail.com> (raw)
In-Reply-To: <1314891670.2733.12.camel@bwh-desktop>
On 2011年09月01日 23:41, Ben Hutchings wrote:
> On Thu, 2011-09-01 at 22:52 +0800, Wang Sheng-Hui wrote:
>> The patch is against 3.1-rc3.
>>
>> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
>> ---
>> net/core/dev.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 17d67b5..de6033c 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -5092,7 +5092,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg)
>> /* Take care of Wireless Extensions */
>> if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST)
>> return wext_handle_ioctl(net, &ifr, cmd, arg);
>> - return -ENOTTY;
>> + return -EINVAL;
>> }
>> }
>>
>
> Whereas, Linus Torvalds wrote in
> <BANLkTin=PTbTwBR2s+owMLy+GmKigeoYvg@mail.gmail.com>:
> [...]
>> The correct error code for "I don't understand this ioctl" is ENOTTY.
>> The naming may be odd, but you should think of that error value as a
>> "unrecognized ioctl number, you're feeding me random numbers that I
>> don't understand and I assume for historical reasons that you tried to
>> do some tty operation on me".
> [...]
>
> (Not that we are consistent about using ENOTTY in networking now.)
>
> Ben.
>
Got it. Thanks.
prev parent reply other threads:[~2011-09-01 22:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-01 14:52 [PATCH] dev_ioctl should return -EINVAL for unknown ioctl instead of -ENOTTY Wang Sheng-Hui
2011-09-01 15:41 ` Ben Hutchings
2011-09-01 22:00 ` Wang Sheng-Hui [this message]
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=4E600090.5030505@gmail.com \
--to=shhuiw@gmail.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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).