🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #1015

Re: [PATCH net 1/1] net: devlink: fix reload error on netns teardown

#1015
From: Jakub Kicinski
Date: Fri, 09 Oct 2026 01:51
20 lines
6079 bytes
On Sun,  4 Oct 2026 02:14:42 +0800 Ren Wei wrote:
>  	err = devlink->ops->reload_down(devlink, !!dest_net, action, limit, extack);
> -	if (err)
> +	if (err) {
> +		curr_net = devlink_net(devlink);
> +		if (dest_net && curr_net->is_dying &&
> +		    !net_eq(dest_net, curr_net))
> +			devlink_reload_netns_change(devlink, curr_net, dest_net);
>  		return err;
> +	}

A bit of a weird place to put this code, and IDK why you're using
is_dying instead of check_net()?

I think the check belongs in devlink_pernet_pre_exit(), where we
know the curr_net is dying. Instead of trying to work backwards
from the netns state in the generic helper.
-- 
pw-bot: cr
Technical Details
Message-ID: <20261008185120.45c9b4c5@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343391-linux-kernel-netdev=dewy.ru
References: <cover.1791019703.git.petalzu987@gmail.com> <51b31e529d844b075e34a3595ba9b0eb183d325f.1791019703.git.petalzu987@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343391-linux-kernel-netdev=dewy.ru
From: kuba@kernel.org (Jakub Kicinski)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 1/1] net: devlink: fix reload error on netns
 teardown
Date: Thu, 8 Oct 2026 18:51:20 -0700
Organization: Usenet Network
Message-ID: <20261008185120.45c9b4c5@kernel.org>
References: <cover.1791019703.git.petalzu987@gmail.com>
	<51b31e529d844b075e34a3595ba9b0eb183d325f.1791019703.git.petalzu987@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1013827"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:a2iET9CbxWhT+Z788wacjckTQDU= sha256:rnGaoBACTzCAcLoocrQlkGRNxF9bDW3uXbtSVi8iHPg=
	sha1:0sXX9ucw2dR04x9pk6LztUsNALc= sha256:R0guS/jqjWAcJkB5oe6zTpmmdJUEUFGZ+9LTfs7dAy4=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 367F110F594; Fri,  9 Oct 2026 04:53:29 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.341
X-Spam-Status: No, score=-1.341 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id LAnKw2RM9mqp;
	Fri,  9 Oct 2026 04:53:26 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-343391-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id BFD3F10F570; Fri,  9 Oct 2026 04:53:18 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 4A96229172; Fri,  9 Oct 2026 01:51:24 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 43E5A31E844;
	Fri,  9 Oct 2026 01:51:23 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kQYmCfAo"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 531CD3385A5
	for <netdev@vger.kernel.org>; Fri,  9 Oct 2026 01:51:22 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791510683; cv=none; b=TVkHm4ABPOGUiLw9wnuIlCOIrHPLeR3+pbtXYJL4ZjkUnrRE3wOPAMm/7aZwCm2KdhUDV5qsGD8JJEENNUwQ6bnZ8DmWQHwz0eRgKsd/1rYWDkurN82fjQk4vVGwI9Yf9qWKRIhqM1jCk6rbQX6cVgZR8jmFBGIPYMsTTPCLg/U=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791510683; c=relaxed/simple;
	bh=FUOyaERmeKclYDE6yxWhoi69duTHXEWQA7W9f4AoZeU=;
	h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:
	 MIME-Version:Content-Type; b=KZ0AeKFvtsjmY76WxzTgglfFF4RYkL2gSi+mxU9lhyczb3l/BsDq2Y8zMB6CUvEv4CCyrfFi7XXkkiQ5lh1U7lvv2BzVgWN7FHEz4fmU1BR4KlY2HsajGgCDAQxQvkY5R4olR32K6VpGEo3lNXyAgJ7bxMVVUiVIZJm0ySNpua4=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kQYmCfAo; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 886421F000FF;
	Fri,  9 Oct 2026 01:51:21 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1791510681;
	bh=dyKVolkUsYjBDwgzYq0OWno/Kd3bSWqcNAkFS2vz3pk=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References;
	b=kQYmCfAoqwRiIxMMrxcZ5Nz2W+JX254mMZ9H14lYUvtnYCO43vkbrWr31BQboYWnk
	 kmY7c5PALoTD1rwhYTZeUplCA0q3STZ7rtJpwSH6+bn7S/Tv/RuWc3/lKXXMUQYAyZ
	 ijtrsvFDRRryOIbAfgjanF/4WVwUCc3adNg9yUWmM7/B2bxZ4VeL4Z56r7rsmPQFQj
	 NNAgwdv7pVFzk5LN5oDsWmy/vHfUeFg1jaLdieLMzd8HBqfqkvlaRF5QqS8pq3jCav
	 hKTY4tY7FALMLzJW0JZFShcvu1aSlxHpKQ+pUp5uqFIaBk0gjfsRRG2HGaM/F10rN1
	 Tuqd1JP1TdyJw==
X-Cc: netdev@vger.kernel.org, jiri@resnulli.us, davem@davemloft.net,
 edumazet@kernel.org, pabeni@redhat.com, horms@kernel.org, vega@nebusec.ai,
 petalzu987@gmail.com
X-In-Reply-To: <51b31e529d844b075e34a3595ba9b0eb183d325f.1791019703.git.petalzu987@gmail.com>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>