Index | Thread | Search

From:
Alexander Bluhm <bluhm@openbsd.org>
Subject:
Re: solisten(): use atomic_load_int() instead of READ_ONCE()
To:
Vitaliy Makkoveev <mvs@openbsd.org>
Cc:
tech@openbsd.org
Date:
Tue, 6 Aug 2024 18:52:11 +0200

Download raw body.

Thread
On Tue, Aug 06, 2024 at 06:43:29PM +0300, Vitaliy Makkoveev wrote:
> For consistency with others.

OK bluhm@

> Index: sys/kern/uipc_socket.c
> ===================================================================
> RCS file: /cvs/src/sys/kern/uipc_socket.c,v
> diff -u -p -r1.341 uipc_socket.c
> --- sys/kern/uipc_socket.c	1 Aug 2024 17:19:01 -0000	1.341
> +++ sys/kern/uipc_socket.c	6 Aug 2024 15:42:11 -0000
> @@ -234,8 +234,8 @@ sobind(struct socket *so, struct mbuf *n
>  int
>  solisten(struct socket *so, int backlog)
>  {
> -	int somaxconn_local = READ_ONCE(somaxconn);
> -	int sominconn_local = READ_ONCE(sominconn);
> +	int somaxconn_local = atomic_load_int(&somaxconn);
> +	int sominconn_local = atomic_load_int(&sominconn);
>  	int error;
>  
>  	switch (so->so_type) {