From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22E6A3D4138 for ; Sat, 28 Feb 2026 22:18:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772317103; cv=none; b=PCoY/iQvXAaHTgrvyQI2MOsKLmUt59DsDPMJYA5pE1Y5tZysev2+DC9O8GbPApoF/jOlowOM6BoiTeQuQMTpwS7pzZ2tVM8yCxwV4tlwbPy+fOm3xZpVV5x9ddX3ZRAiTOZbanW68CmMM9H0FWgMJTVahajRfFZTQIsbJ7sMizQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772317103; c=relaxed/simple; bh=8edKCUFaLjIwesHS8h3qv516Soi9a4CbyUL4GPAi2hQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=nFxfpuly8GtBqVu0z7gljlv9DAM1Zm1rESP3FtVJiK6to4tWx52uVJae7jF99ABNhXPQcA9HtTwoP9+3a95yk6K6yRdXHIIurYRL02FvsJF0dItyge1A56ui2hAZntgpqOkVJANcwIv3AUhCTIo38Xn4KAR7+XdpXHRQ1zFfrhM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--kuniyu.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=qy2YPbsZ; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--kuniyu.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qy2YPbsZ" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-3597b55adebso397336a91.2 for ; Sat, 28 Feb 2026 14:18:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772317101; x=1772921901; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=gegRj4p5p/pHmtcdiqVwTPBlwLpfq+G6oQK0L93+Hec=; b=qy2YPbsZ5sWERllpnfPzx0hBEILHNSFt5yh1SKztq29zbUhrT8ql4LVjPqKqmnSDrQ lLGIkFJW1NWI2q2ho2zYcULouECMMPwGytmp/mPp9LcLn8PtIKl7Km7/V4PpWUrIigmH WnvN4G8/sVecw6wIEdrI1fVSguzqo1RSePEYFrdnxEGWlTejG12qMKiaSg7xhDfmrg61 0bISR5hNC8I6WFDirQ/CyoPR5dFV/3XQxp40c3oDvM4fduNOcvIpFlq2dONzORL9MHr+ ctDNL2aglZGv4bJfETsyCQTuTri3u5I4Z4gEQtatoyD/6d4uYyNOlI0xZILjYntjcHwH HekA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772317101; x=1772921901; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gegRj4p5p/pHmtcdiqVwTPBlwLpfq+G6oQK0L93+Hec=; b=pzbdhvjphBFQ2SE6bZrR97eDt1ee05m2nOxZIHacMlK8rXslKL7H6/gEr6AEw87rFU NA41KPNrtYRi7JWy+FccBiHi2pu5QwzB6XBXeXQywRN0K1B4KKO6zVyo9l0aJEyN8D8K 4pRkbeAiXlPGes/nsN64qrd/xw+XbV5PiUR4U+S5LM2GrbxFqcBM8UKAWCIGfXJ+QOVU Mk7BL93n+FbbfLXSjHc0xbCVuZfVOox06LXfDaLeFuiPUGLgQSsxv8skjHIL3rcm1pv8 C1kKo0btn896NffMWNCQvDphylBYlHRY18NBr36AjfkNLMfZlrPbewXigJC8oHLuInYV /3eg== X-Forwarded-Encrypted: i=1; AJvYcCXLmAvPaDmrHs6DLYNIHdGM4GHXxIy06p5sCTLkHfaQ26dX7pc68cdqtY1Z7Q4CXlAcNdHvxSk=@vger.kernel.org X-Gm-Message-State: AOJu0YytaTOSU0tHl3smFfo3uqPtxeXD+SkAriI2bpFHz/gIya1Q1MQQ ge/LGeszKvV/DRab/ZuX8+U4I5jivtTIkQSC0qT+iZcCo2G2NaK2OYPwH1y+1FXRoG5/0Pp9d8m yHqIdKw== X-Received: from pjsv2.prod.google.com ([2002:a17:90a:6342:b0:359:852c:bcbb]) (user=kuniyu job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:524a:b0:356:24f0:aef5 with SMTP id 98e67ed59e1d1-35965cd0e5dmr6030042a91.22.1772317101394; Sat, 28 Feb 2026 14:18:21 -0800 (PST) Date: Sat, 28 Feb 2026 22:17:29 +0000 In-Reply-To: <20260228221800.1082070-1-kuniyu@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260228221800.1082070-1-kuniyu@google.com> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog Message-ID: <20260228221800.1082070-12-kuniyu@google.com> Subject: [PATCH v3 net-next 11/15] ipmr: Call fib_rules_unregister() without RTNL. From: Kuniyuki Iwashima To: "David S . Miller" , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , Kuniyuki Iwashima , Kuniyuki Iwashima , netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" fib_rules_unregister() removes ops from net->rules_ops under spinlock, calls ops->delete() for each rule, and frees the ops. ipmr_rules_ops_template does not have ->delete(), and any operation does not require RTNL there. Let's move fib_rules_unregister() from ipmr_rules_exit_rtnl() to ipmr_net_exit(). Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet --- net/ipv4/ipmr.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index c22bcaead348..07f2d4f8dcbe 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -282,6 +282,11 @@ static int __net_init ipmr_rules_init(struct net *net) return err; } +static void __net_exit ipmr_rules_exit(struct net *net) +{ + fib_rules_unregister(net->ipv4.mr_rules_ops); +} + static void __net_exit ipmr_rules_exit_rtnl(struct net *net, struct list_head *dev_kill_list) { @@ -291,8 +296,6 @@ static void __net_exit ipmr_rules_exit_rtnl(struct net *net, list_del(&mrt->list); ipmr_free_table(mrt, dev_kill_list); } - - fib_rules_unregister(net->ipv4.mr_rules_ops); } static int ipmr_rules_dump(struct net *net, struct notifier_block *nb, @@ -348,6 +351,10 @@ static int __net_init ipmr_rules_init(struct net *net) return 0; } +static void __net_exit ipmr_rules_exit(struct net *net) +{ +} + static void __net_exit ipmr_rules_exit_rtnl(struct net *net, struct list_head *dev_kill_list) { @@ -3286,6 +3293,7 @@ static int __net_init ipmr_net_init(struct net *net) remove_proc_entry("ip_mr_vif", net->proc_net); proc_vif_fail: ipmr_rules_exit_rtnl(net, &dev_kill_list); + ipmr_rules_exit(net); #endif ipmr_rules_fail: ipmr_notifier_exit(net); @@ -3299,6 +3307,7 @@ static void __net_exit ipmr_net_exit(struct net *net) remove_proc_entry("ip_mr_cache", net->proc_net); remove_proc_entry("ip_mr_vif", net->proc_net); #endif + ipmr_rules_exit(net); ipmr_notifier_exit(net); } -- 2.53.0.473.g4a7958ca14-goog