From 6bc8f20c1d9348bdf9ce387228c1b16ce4a301ad Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 27 Oct 2020 09:09:41 +0000 Subject: [PATCH 1/2] vsock: remove ratelimit unknown ioctl message 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. Remove this message. Signed-off-by: Colin Ian King Reviewed-by: Stefano Garzarella Signed-off-by: Jakub Kicinski --- net/vmw_vsock/af_vsock.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index b4d7b8aba003..9c4cd822bd97 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -2072,7 +2072,6 @@ static long vsock_dev_do_ioctl(struct file *filp, break; default: - pr_err("Unknown ioctl %d\n", cmd); retval = -EINVAL; } From c3e448cdc04071d1c420e7da87bafff22022a675 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 27 Oct 2020 09:09:42 +0000 Subject: [PATCH 2/2] vsock: fix the error return when an invalid ioctl command is used Currently when an invalid ioctl command is used the error return is -EINVAL. Fix this by returning the correct error -ENOIOCTLCMD. Signed-off-by: Colin Ian King Reviewed-by: Stefano Garzarella Signed-off-by: Jakub Kicinski --- 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 9c4cd822bd97..35613efbb1ec 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: - retval = -EINVAL; + retval = -ENOIOCTLCMD; } return retval;