Re: [PATCH] smb/server: use sock_create_kern() in create_socket()

From: Kuniyuki Iwashima
Date: Mon Mar 24 2025 - 18:13:12 EST


From: David Laight <david.laight.linux@xxxxxxxxx>
Date: Mon, 24 Mar 2025 21:07:47 +0000
> On Mon, 24 Mar 2025 06:51:55 +0000
> chenxiaosong@xxxxxxxxxxxxxxxx wrote:
>
> > From: ChenXiaoSong <chenxiaosong@xxxxxxxxxx>
> >
> > The socket resides in kernel space, so use sock_create_kern()
> > instead of sock_create().
>
> As in the other patches you need to worry about whether the socket
> holds a reference to the network namespace.

Right, and if you don't see any real issue, I recommend leaving
it as is for now because we have seen many refcount issues for
kernel TCP sockets.

And I totally forgot to respin my series after holiday to clean
up such callers.
https://lore.kernel.org/netdev/20241213092152.14057-1-kuniyu@xxxxxxxxxx/

I'll repost v4 after the merge window with some modification

1. be less invasive as suggested by Paolo
2. use sk_net_refcnt_upgrade()