Skip to contentSkip to conversation

vsock: minor clean up of ioctl error handling

PATCH Applied Colin King 3 participants 6 messages Oct 27, 2020 – Oct 30, 2020

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

cover vsock: minor clean up of ioctl error handling

From: Colin Ian King <[email protected]>

Two minor changes to the ioctl error handling.

Colin Ian King (2):
vsock: remove ratelimit unknown ioctl message
vsock: fix the error return when an invalid ioctl command is used

 net/vmw_vsock/af_vsock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Signature · 1 line
2.27.0
author
#1 lore raw

PATCH v2 1/2 vsock: remove ratelimit unknown ioctl message

From: Colin Ian King <[email protected]>

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.

---
 net/vmw_vsock/af_vsock.c | 1 -
 1 file changed, 1 deletion(-)
net/vmw_vsock/af_vsock.c +0 -1
index 9e93bc201cc0..865331b809e4 100644
@@ -2072,7 +2072,6 @@ static long vsock_dev_do_ioctl(struct file *filp,
 		break;
 
 	default:
-		pr_err("Unknown ioctl %d\n", cmd);
 		retval = -EINVAL;
 	}
 
Signature · 1 line
2.27.0
maintainer Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH 1/2][V2] vsock: remove ratelimit unknown ioctl message

Quoted 10 lines · Colin King

From: Colin Ian King <[email protected]>

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.

---
net/vmw_vsock/af_vsock.c | 1 -

1 file changed, 1 deletion(-)
Quoted 16 lines
net/vmw_vsock/af_vsock.c +0 -1
index 9e93bc201cc0..865331b809e4 100644
@@ -2072,7 +2072,6 @@ static long vsock_dev_do_ioctl(struct file *filp,
 		break;
 
 	default:
-		pr_err("Unknown ioctl %d\n", cmd);
 		retval = -EINVAL;
 	}
 
Signature · 1 line
2.27.0
author
#3 lore raw

PATCH 2/2 vsock: fix the error return when an invalid ioctl command is used

In reply to Colin King

From: Colin Ian King <[email protected]>

Currently when an invalid ioctl command is used the error return is -EINVAL. Fix this by returning the correct error -ENOIOCTLCMD.

---
 net/vmw_vsock/af_vsock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/vmw_vsock/af_vsock.c +1 -1
index 865331b809e4..597c86413089 100644
@@ -2072,7 +2072,7 @@ static long vsock_dev_do_ioctl(struct file *filp,
 		break;
 
 	default:
-		retval = -EINVAL;
+		retval = -ENOIOCTLCMD;
 	}
 
 	return retval;
Signature · 1 line
2.27.0
maintainer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] vsock: fix the error return when an invalid ioctl command is used

Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

Currently when an invalid ioctl command is used the error return is -EINVAL. Fix this by returning the correct error -ENOIOCTLCMD.

---
net/vmw_vsock/af_vsock.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 17 lines
net/vmw_vsock/af_vsock.c +1 -1
index 865331b809e4..597c86413089 100644
@@ -2072,7 +2072,7 @@ static long vsock_dev_do_ioctl(struct file *filp,
 		break;
 
 	default:
-		retval = -EINVAL;
+		retval = -ENOIOCTLCMD;
 	}
 
 	return retval;
Signature · 1 line
2.27.0