Re: [PATCH v2 net-next 3/7] socket: Restore sock_create_kern().

From
David Laight <hidden>
Date
2025-06-03 21:32:57
Also in
linux-nfs, linux-nvme, linux-rdma, mptcp
Reply to
Christoph Hellwig, 2025-06-02
On Mon, 2 Jun 2025 07:08:17 +0200
Christoph Hellwig [off-list ref] wrote:
On Thu, May 29, 2025 at 07:53:41PM -0700, Kuniyuki Iwashima wrote:
quoted
In the old days, sock_create_kern() did take a ref to netns,
but an implicit change that avoids taking the ref has caused
a lot of problems for people who used to the old semantics.
That must have been a long time ago.
Was it even long after the namespace code was added?
(I don't have a system with the git tree up at the moment)
quoted
This series rather rolls back the change, so I think using
the same name here is better than leaving the catchy
sock_create_kern() error-prone.  
Ok.
Except that you are changing the semantics again.
So you end up with the same problem the other way around.
I can imagine code ending up with an extra reference to the ns.

The obvious name a a function for general driver use would be
kernel_socket() - matching the other functions that were added
when set_fs(KERNEL_DS) was removed.

I definitely aim to end up where the existing code fails to
compile - just to ensure all the code is found.

	David
Thread (32 messages) 32 messages, 4 authors, last reply 2025-06-05
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help