Subject: Re: [patch net-next v7 5/9] genetlink: introduce per-sock family private storage

From: Jakub Kicinski <[email-masked]>
Date: Fri, 15 Dec 2023 17:47:07 -0800

Sorry for the latency...

On Fri, 15 Dec 2023 11:17:14 +0100 Jiri Pirko wrote:
> Wait, let me make your suggestion clear. Do you suggest to remove the
> WARN_ON_ONCE from __genl_sk_priv_get() as well?
> 
> To put it in code:
> void *__genl_sk_priv_get(struct genl_family *family, struct sock *sk)
> {
> 	if (WARN_ON_ONCE(!family->sock_privs))
> 		return ERR_PTR(-EINVAL);
> 	return xa_load(family->sock_privs, (unsigned long) sk);
> }

I meant this, although no strong feelings.

> OR:
> void *__genl_sk_priv_get(struct genl_family *family, struct sock *sk)
> {
> 	if (!family->sock_privs)
> 		return ERR_PTR(-EINVAL);
> 	return xa_load(family->sock_privs, (unsigned long) sk);
> }
> ?