mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] af_unix: Correct comment to reference kfree_skb_reason hook
@ 2025-01-24  1:51 Liang Jie
  2025-01-24  2:11 ` Kuniyuki Iwashima
  0 siblings, 1 reply; 2+ messages in thread
From: Liang Jie @ 2025-01-24  1:51 UTC (permalink / raw)
  To: Kuniyuki Iwashima, Jakub Kicinski
  Cc: David S. Miller, Eric Dumazet, Paolo Abeni, Simon Horman,
	Michal Luczaj, netdev, linux-kernel, Liang Jie

From: Liang Jie <liangjie@lixiang.com>

The comment in unix_release_sock has been updated to correctly reference
kfree_skb_reason instead of kfree_skb, for clarity on how passed file
descriptors are handled during socket closure.

Fixes: c32f0bd7d483 ("af_unix: Set drop reason in unix_release_sock().")
Signed-off-by: Liang Jie <liangjie@lixiang.com>
---
 net/unix/af_unix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 34945de1fb1f..47dd3749ce32 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -717,7 +717,7 @@ static void unix_release_sock(struct sock *sk, int embrion)
 		if (state == TCP_LISTEN)
 			unix_release_sock(skb->sk, 1);
 
-		/* passed fds are erased in the kfree_skb hook */
+		/* passed fds are erased in the kfree_skb_reason hook */
 		kfree_skb_reason(skb, SKB_DROP_REASON_SOCKET_CLOSE);
 	}
 
-- 
2.25.1


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

* Re: [PATCH net] af_unix: Correct comment to reference kfree_skb_reason hook
  2025-01-24  1:51 [PATCH net] af_unix: Correct comment to reference kfree_skb_reason hook Liang Jie
@ 2025-01-24  2:11 ` Kuniyuki Iwashima
  0 siblings, 0 replies; 2+ messages in thread
From: Kuniyuki Iwashima @ 2025-01-24  2:11 UTC (permalink / raw)
  To: buaajxlj
  Cc: davem, edumazet, horms, kuba, kuniyu, liangjie, linux-kernel,
	mhal, netdev, pabeni

From: Liang Jie <buaajxlj@163.com>
Date: Fri, 24 Jan 2025 09:51:06 +0800
> From: Liang Jie <liangjie@lixiang.com>
> 
> The comment in unix_release_sock has been updated to correctly reference
> kfree_skb_reason instead of kfree_skb, for clarity on how passed file
> descriptors are handled during socket closure.
> 
> Fixes: c32f0bd7d483 ("af_unix: Set drop reason in unix_release_sock().")

This is net-next material and Fixes tag is not needed.

I don't think we need to update the comment though..

kfree_skb 'hook' generally means skb->destructor() and _reason is
not relevant here.

kfree_skb
  kfree_skb_reason
    sk_skb_reason_drop
      __kfree_skb
        skb_release_all
          skb_release_head_state
            skb->destructor / unix_destruct_scm <--


> Signed-off-by: Liang Jie <liangjie@lixiang.com>
> ---
>  net/unix/af_unix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 34945de1fb1f..47dd3749ce32 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -717,7 +717,7 @@ static void unix_release_sock(struct sock *sk, int embrion)
>  		if (state == TCP_LISTEN)
>  			unix_release_sock(skb->sk, 1);
>  
> -		/* passed fds are erased in the kfree_skb hook */
> +		/* passed fds are erased in the kfree_skb_reason hook */
>  		kfree_skb_reason(skb, SKB_DROP_REASON_SOCKET_CLOSE);
>  	}
>  
> -- 
> 2.25.1

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

end of thread, other threads:[~2025-01-24  2:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-24  1:51 [PATCH net] af_unix: Correct comment to reference kfree_skb_reason hook Liang Jie
2025-01-24  2:11 ` Kuniyuki Iwashima

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

all inboxes | Powered by JetHome®