Subject: Re: [PATCH net 1/1] ovpn: fix race between deleting interface and adding new peer

From: Jakub Kicinski <[email-masked]>
Date: Wed, 22 Apr 2026 19:20:50 -0700

On Wed, 22 Apr 2026 14:32:42 +0200 Antonio Quartulli wrote:
> +	/* Prevent adding new peers while destroying the ovpn interface.
> +	 * Failing to do so would end up holding the device reference
> +	 * endlessly hostage of the new peer object with no chance of
> +	 * release..
> +	 */
> +	if (ovpn->dev->reg_state >= NETREG_UNREGISTERING)
> +		return -ENODEV;

AI review suggests wrapping reg_state read in READ_ONCE(), I think
that's legit. Also nit: I think > or != REGISTERED would be more
idiomatic than comparing >= UNREGSITERING ?

If you agree make sure Sashiko doesn't complain about anything else
once it's public:
https://sashiko.dev/#/patchset/[email-masked]