The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net-next] af_unix: Remove unix_unhash()
@ 2025-04-09 12:50 Michal Luczaj
  2025-04-09 20:20 ` Kuniyuki Iwashima
  2025-04-11  0:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Luczaj @ 2025-04-09 12:50 UTC (permalink / raw)
  To: Kuniyuki Iwashima, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman
  Cc: netdev, linux-kernel, bpf, Michal Luczaj

Dummy unix_unhash() was introduced for sockmap in commit 94531cfcbe79
("af_unix: Add unix_stream_proto for sockmap"), but there's no need to
implement it anymore.

->unhash() is only called conditionally: in unix_shutdown() since commit
d359902d5c35 ("af_unix: Fix NULL pointer bug in unix_shutdown"), and in BPF
proto's sock_map_unhash() since commit 5b4a79ba65a1 ("bpf, sockmap: Don't
let sock_map_{close,destroy,unhash} call itself").

Remove it.

Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
 net/unix/af_unix.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index f78a2492826f9cc1e302ee6f8ca93c367656670a..2ab20821d6bb244a09e0364e1c649042360e23b1 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -950,13 +950,6 @@ static void unix_close(struct sock *sk, long timeout)
 	 */
 }
 
-static void unix_unhash(struct sock *sk)
-{
-	/* Nothing to do here, unix socket does not need a ->unhash().
-	 * This is merely for sockmap.
-	 */
-}
-
 static bool unix_bpf_bypass_getsockopt(int level, int optname)
 {
 	if (level == SOL_SOCKET) {
@@ -987,7 +980,6 @@ struct proto unix_stream_proto = {
 	.owner			= THIS_MODULE,
 	.obj_size		= sizeof(struct unix_sock),
 	.close			= unix_close,
-	.unhash			= unix_unhash,
 	.bpf_bypass_getsockopt	= unix_bpf_bypass_getsockopt,
 #ifdef CONFIG_BPF_SYSCALL
 	.psock_update_sk_prot	= unix_stream_bpf_update_proto,

---
base-commit: 420aabef3ab5fa743afb4d3d391f03ef0e777ca8
change-id: 20250406-cleanup-drop-unix-unhash-623dd3bcd946

Best regards,
-- 
Michal Luczaj <mhal@rbox.co>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] af_unix: Remove unix_unhash()
  2025-04-09 12:50 [PATCH net-next] af_unix: Remove unix_unhash() Michal Luczaj
@ 2025-04-09 20:20 ` Kuniyuki Iwashima
  2025-04-11  0:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Kuniyuki Iwashima @ 2025-04-09 20:20 UTC (permalink / raw)
  To: mhal
  Cc: bpf, davem, edumazet, horms, kuba, kuniyu, linux-kernel, netdev,
	pabeni

From: Michal Luczaj <mhal@rbox.co>
Date: Wed, 09 Apr 2025 14:50:58 +0200
> Dummy unix_unhash() was introduced for sockmap in commit 94531cfcbe79
> ("af_unix: Add unix_stream_proto for sockmap"), but there's no need to
> implement it anymore.
> 
> ->unhash() is only called conditionally: in unix_shutdown() since commit
> d359902d5c35 ("af_unix: Fix NULL pointer bug in unix_shutdown"), and in BPF
> proto's sock_map_unhash() since commit 5b4a79ba65a1 ("bpf, sockmap: Don't
> let sock_map_{close,destroy,unhash} call itself").
> 
> Remove it.
> 
> Signed-off-by: Michal Luczaj <mhal@rbox.co>

Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] af_unix: Remove unix_unhash()
  2025-04-09 12:50 [PATCH net-next] af_unix: Remove unix_unhash() Michal Luczaj
  2025-04-09 20:20 ` Kuniyuki Iwashima
@ 2025-04-11  0:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-04-11  0:50 UTC (permalink / raw)
  To: Michal Luczaj
  Cc: kuniyu, davem, edumazet, kuba, pabeni, horms, netdev,
	linux-kernel, bpf

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 09 Apr 2025 14:50:58 +0200 you wrote:
> Dummy unix_unhash() was introduced for sockmap in commit 94531cfcbe79
> ("af_unix: Add unix_stream_proto for sockmap"), but there's no need to
> implement it anymore.
> 
> ->unhash() is only called conditionally: in unix_shutdown() since commit
> d359902d5c35 ("af_unix: Fix NULL pointer bug in unix_shutdown"), and in BPF
> proto's sock_map_unhash() since commit 5b4a79ba65a1 ("bpf, sockmap: Don't
> let sock_map_{close,destroy,unhash} call itself").
> 
> [...]

Here is the summary with links:
  - [net-next] af_unix: Remove unix_unhash()
    https://git.kernel.org/netdev/net-next/c/709894c52c1c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-11  0:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-09 12:50 [PATCH net-next] af_unix: Remove unix_unhash() Michal Luczaj
2025-04-09 20:20 ` Kuniyuki Iwashima
2025-04-11  0:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox