Revert "net: set SOCK_RCU_FREE before inserting socket into hashtable"

This reverts commit 55d08f4214.
This commit is contained in:
Ksawlii 2024-11-24 00:23:47 +01:00
parent 179a92ca0d
commit 8f420f8031

View file

@ -653,7 +653,6 @@ int __inet_hash(struct sock *sk, struct sock *osk)
if (err)
goto unlock;
}
sock_set_flag(sk, SOCK_RCU_FREE);
if (IS_ENABLED(CONFIG_IPV6) && sk->sk_reuseport &&
sk->sk_family == AF_INET6)
__sk_nulls_add_node_tail_rcu(sk, &ilb->nulls_head);
@ -661,6 +660,7 @@ int __inet_hash(struct sock *sk, struct sock *osk)
__sk_nulls_add_node_rcu(sk, &ilb->nulls_head);
inet_hash2(hashinfo, sk);
ilb->count++;
sock_set_flag(sk, SOCK_RCU_FREE);
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
unlock:
spin_unlock(&ilb->lock);