[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201026093917.5zgginii65pq6ezd@steredhat>
Date: Mon, 26 Oct 2020 10:39:17 +0100
From: Stefano Garzarella <sgarzare@...hat.com>
To: David Laight <David.Laight@...lab.com>
Cc: Colin King <colin.king@...onical.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] vsock: ratelimit unknown ioctl error message
On Mon, Oct 26, 2020 at 09:13:23AM +0000, David Laight wrote:
>From: Stefano Garzarella
>> Sent: 26 October 2020 08:43
>...
>> >Isn't the canonical error for unknown ioctl codes -ENOTTY?
>> >
>>
>> Oh, thanks for pointing that out!
>>
>> I had not paid attention to the error returned, but looking at it I
>> noticed that perhaps the most appropriate would be -ENOIOCTLCMD.
>> In the ioctl syscall we return -ENOTTY, if the callback returns
>> -ENOIOCTLCMD.
>>
>> What do you think?
>
>It is 729 v 443 in favour of ENOTTY (based on grep).
Under net/ it is 6 vs 83 in favour of ENOIOCTLCMD.
>
>No idea where ENOIOCTLCMD comes from, but ENOTTY probably
>goes back to the early 1970s.
Me too.
>
>The fact that the ioctl wrapper converts the value is a good
>hint that userspace expects ENOTTY.
Agree on that, but since we are not interfacing directly with userspace,
I think it is better to return the more specific error (ENOIOCTLCMD).
Thanks,
Stefano
Powered by blists - more mailing lists