Re: [PATCH net v2] net/smc: prevent device removal during connection setup
From: Simon Horman
Date: Wed Aug 26 2026 - 05:11:29 EST
On Sun, Aug 23, 2026 at 11:37:17AM +0200, Markus Elfring wrote:
> …
> > This change is limited to the reported SMCR lifetime race. SMC-D device
> > selection has a similar pre-existing borrowed-pointer lifetime issue and
> > requires a separate fix.
>
> May lock guards be applied?
> https://elixir.bootlin.com/linux/v7.2/source/include/linux/mutex.h#L253
This approach seems fine to me.
Quoting the documentation:
Use of guard() is discouraged within any function longer than 20 lines,
scoped_guard() is considered more readable. Using normal lock/unlock is
still (weakly) preferred.
Link: https://docs.kernel.org/process/maintainer-netdev.html#using-device-managed-and-cleanup-h-constructs
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>