Subject: Re: [patch net-next v3 1/3] net: devlink: allow to change namespaces

From: Jakub Kicinski <[email-masked]>
Date: Mon, 12 Aug 2019 18:21:22 -0700

On Mon, 12 Aug 2019 15:47:49 +0200, Jiri Pirko wrote:
> @@ -6953,9 +7089,33 @@ int devlink_compat_switch_id_get(struct net_device *dev,
>  	return 0;
>  }
>  
> +static void __net_exit devlink_pernet_exit(struct net *net)
> +{
> +	struct devlink *devlink;
> +
> +	mutex_lock(&devlink_mutex);
> +	list_for_each_entry(devlink, &devlink_list, list)
> +		if (net_eq(devlink_net(devlink), net))
> +			devlink_netns_change(devlink, &init_net);
> +	mutex_unlock(&devlink_mutex);
> +}

Just to be sure - this will not cause any locking issues?
Usually the locking order goes devlink -> rtnl