public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuni1840@gmail.com>, <netdev@vger.kernel.org>
Subject: Re: [PATCH v1 net-next 6/6] socket: Clean up kdoc for sock_create() and sock_create_lite().
Date: Mon, 19 May 2025 13:43:09 +0100	[thread overview]
Message-ID: <20250519134309.35b1e007@pumpkin> (raw)
In-Reply-To: <20250517035120.55560-7-kuniyu@amazon.com>

On Fri, 16 May 2025 20:50:27 -0700
Kuniyuki Iwashima <kuniyu@amazon.com> wrote:

> __sock_create() is now static and the same doc exists on sock_create()
> and sock_create_kern().
> 
> Also, __sock_create() says "On failure @res is set to %NULL.", but
> this is always false.
> 
> In addition, the old style kdoc is a bit corrupted and we can't see the
> DESCRIPTION section:
> 
>   $ scripts/kernel-doc -man net/socket.c | scripts/split-man.pl /tmp/man
>   $ man /tmp/man/sock_create.9
> 
> Let's clean them up.

I think you need to absolutely explicit about which calls hold a reference
to 'net' and which don't.

This is separate from any user/kernel flag - and may need a second flag
(although there are probably only 3 options).

IIRC some sockets are created internally within the protocol code
and don't want to stop the 'net' being deleted.
Such code has to have a callback from the 'net delete' path to tidy up.

OTOH it is not unreasonable for other kernel activities (perhaps file
system mounts) to hold a ref count to stop the net being deleted.

	David

  reply	other threads:[~2025-05-19 12:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-17  3:50 [PATCH v1 net-next 0/6] socket: Make sock_create_kern() robust against misuse Kuniyuki Iwashima
2025-05-17  3:50 ` [PATCH v1 net-next 1/6] socket: Un-export __sock_create() Kuniyuki Iwashima
2025-05-19 12:16   ` David Laight
2025-05-19 17:16     ` Kuniyuki Iwashima
2025-05-17  3:50 ` [PATCH v1 net-next 2/6] socket: Rename sock_create_kern() to __sock_create_kern() Kuniyuki Iwashima
2025-05-22 15:01   ` Matthieu Baerts
2025-05-17  3:50 ` [PATCH v1 net-next 3/6] socket: Restore sock_create_kern() Kuniyuki Iwashima
2025-05-22 15:02   ` Matthieu Baerts
2025-05-22 16:23     ` Kuniyuki Iwashima
2025-05-17  3:50 ` [PATCH v1 net-next 4/6] socket: Remove kernel socket conversion except for net/rds/ Kuniyuki Iwashima
2025-05-22  8:55   ` Paolo Abeni
2025-05-22 16:12     ` Kuniyuki Iwashima
2025-05-22 16:38     ` Chuck Lever
2025-05-22 17:04       ` Kuniyuki Iwashima
2025-05-23  4:23     ` Christoph Hellwig
2025-05-22 15:03   ` Matthieu Baerts
2025-05-17  3:50 ` [PATCH v1 net-next 5/6] socket: Replace most sock_create() calls with sock_create_kern() Kuniyuki Iwashima
2025-05-22  9:11   ` Paolo Abeni
2025-05-17  3:50 ` [PATCH v1 net-next 6/6] socket: Clean up kdoc for sock_create() and sock_create_lite() Kuniyuki Iwashima
2025-05-19 12:43   ` David Laight [this message]
2025-05-19 17:28     ` Kuniyuki Iwashima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250519134309.35b1e007@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox