diff mbox series

[V1] net: qrtr: ns: Return 0 if server port is not present

Message ID 1703153211-3717-2-git-send-email-quic_sarannya@quicinc.com (mailing list archive)
State Not Applicable
Headers show
Series [V1] net: qrtr: ns: Return 0 if server port is not present | expand

Commit Message

Sarannya S Dec. 21, 2023, 10:06 a.m. UTC
When a 'DEL_CLIENT' message is received from the remote, the corresponding
server port gets deleted. A DEL_SERVER message is then announced for this
server. As part of handling the subsequent DEL_SERVER message, the name-
server attempts to delete the server port which results in a '-ENOENT' error.
The return value from server_del() is then propagated back to qrtr_ns_worker,
causing excessive error prints.
To address this, return 0 from control_cmd_del_server() without checking the
return value of server_del(), since the above scenario is not an error case
and hence server_del() doesn't have any other error return value.

Signed-off-by: Sarannya Sasikumar <quic_sarannya@quicinc.com>
---
 net/qrtr/ns.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Simon Horman Dec. 23, 2023, 1:58 p.m. UTC | #1
[Dropped bjorn.andersson@kernel.org, as the correct address seems
 to be andersson@kernel.org, which is already in the CC list.
 kernel.org rejected sending this email without that update.]

On Thu, Dec 21, 2023 at 03:36:51PM +0530, Sarannya S wrote:
> When a 'DEL_CLIENT' message is received from the remote, the corresponding
> server port gets deleted. A DEL_SERVER message is then announced for this
> server. As part of handling the subsequent DEL_SERVER message, the name-
> server attempts to delete the server port which results in a '-ENOENT' error.
> The return value from server_del() is then propagated back to qrtr_ns_worker,
> causing excessive error prints.
> To address this, return 0 from control_cmd_del_server() without checking the
> return value of server_del(), since the above scenario is not an error case
> and hence server_del() doesn't have any other error return value.
> 
> Signed-off-by: Sarannya Sasikumar <quic_sarannya@quicinc.com>

Thanks,

I have a suggestion below. But that notwithstanding this change
looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>

> ---
>  net/qrtr/ns.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c
> index b1db0b5..abb0c70 100644
> --- a/net/qrtr/ns.c
> +++ b/net/qrtr/ns.c
> @@ -512,7 +512,9 @@ static int ctrl_cmd_del_server(struct sockaddr_qrtr *from,
>  	if (!node)
>  		return -ENOENT;
>  
> -	return server_del(node, port, true);
> +	server_del(node, port, true);
> +
> +	return 0;
>  }

With this change the return value of server_del() now seems to be
ignored by all callers. Perhaps it would make sense to update it
to return void?

>  
>  static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from,
> -- 
> 2.7.4
> 
>
patchwork-bot+netdevbpf@kernel.org Jan. 1, 2024, 6:50 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 21 Dec 2023 15:36:51 +0530 you wrote:
> When a 'DEL_CLIENT' message is received from the remote, the corresponding
> server port gets deleted. A DEL_SERVER message is then announced for this
> server. As part of handling the subsequent DEL_SERVER message, the name-
> server attempts to delete the server port which results in a '-ENOENT' error.
> The return value from server_del() is then propagated back to qrtr_ns_worker,
> causing excessive error prints.
> To address this, return 0 from control_cmd_del_server() without checking the
> return value of server_del(), since the above scenario is not an error case
> and hence server_del() doesn't have any other error return value.
> 
> [...]

Here is the summary with links:
  - [V1] net: qrtr: ns: Return 0 if server port is not present
    https://git.kernel.org/netdev/net/c/9bf2e9165f90

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c
index b1db0b5..abb0c70 100644
--- a/net/qrtr/ns.c
+++ b/net/qrtr/ns.c
@@ -512,7 +512,9 @@  static int ctrl_cmd_del_server(struct sockaddr_qrtr *from,
 	if (!node)
 		return -ENOENT;
 
-	return server_del(node, port, true);
+	server_del(node, port, true);
+
+	return 0;
 }
 
 static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from,