[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201026084300.5ag24vck3zeb4mcz@steredhat>
Date: Mon, 26 Oct 2020 09:43:00 +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 Fri, Oct 23, 2020 at 09:30:59PM +0000, David Laight wrote:
>
>From: Stefano Garzarella
>> Sent: 23 October 2020 15:10
>>
>> On Fri, Oct 23, 2020 at 01:21:13PM +0100, Colin King wrote:
>> >From: Colin Ian King <colin.king@...onical.com>
>> >
>> >When exercising the kernel with stress-ng with some ioctl tests the
>> >"Unknown ioctl" error message is spamming the kernel log at a high
>> >rate. Rate limit this message to reduce the noise.
>> >
>> >Signed-off-by: Colin Ian King <colin.king@...onical.com>
>> >---
>> > net/vmw_vsock/af_vsock.c | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> >diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
>> >index 9e93bc201cc0..b8feb9223454 100644
>> >--- a/net/vmw_vsock/af_vsock.c
>> >+++ b/net/vmw_vsock/af_vsock.c
>> >@@ -2072,7 +2072,7 @@ static long vsock_dev_do_ioctl(struct file *filp,
>> > break;
>> >
>> > default:
>> >- pr_err("Unknown ioctl %d\n", cmd);
>> >+ pr_err_ratelimited("Unknown ioctl %d\n", cmd);
>>
>> Make sense, or maybe can we remove the error message returning only the
>> -EINVAL?
>
>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?
Stefano
Powered by blists - more mailing lists