From: Ido Schimmel <idosch@idosch.org>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: edumazet@google.com, davem@davemloft.net, horms@kernel.org,
kuba@kernel.org, kuni1840@gmail.com, netdev@vger.kernel.org,
pabeni@redhat.com
Subject: Re: [PATCH v1 net-next 6/6] fib: rules: Convert RTM_DELRULE to per-netns RTNL.
Date: Thu, 6 Feb 2025 13:22:28 +0200 [thread overview]
Message-ID: <Z6SbdEENQ9Qku6av@shredder> (raw)
In-Reply-To: <20250206095221.24542-1-kuniyu@amazon.com>
On Thu, Feb 06, 2025 at 06:52:21PM +0900, Kuniyuki Iwashima wrote:
> From: Eric Dumazet <edumazet@google.com>
> Date: Thu, 6 Feb 2025 10:41:12 +0100
> > On Thu, Feb 6, 2025 at 9:49 AM Kuniyuki Iwashima <kuniyu@amazon.com> wrote:
> > >
> > > fib_nl_delrule() is the doit() handler for RTM_DELRULE but also called
> > > 1;95;0cfrom vrf_newlink() in case something fails in vrf_add_fib_rules().
> > >
> > > In the latter case, RTNL is already held and the 3rd arg extack is NULL.
> > >
> > > Let's hold per-netns RTNL in fib_nl_delrule() if extack is NULL.
> > >
> > > Now we can place ASSERT_RTNL_NET() in call_fib_rule_notifiers().
> > >
> > > While at it, fib_rule r is moved to the suitable scope.
> > >
> > > Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> > > ---
> > > net/core/fib_rules.c | 29 +++++++++++++++++++----------
> > > 1 file changed, 19 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
> > > index cc26c762fa9e..3430d026134d 100644
> > > --- a/net/core/fib_rules.c
> > > +++ b/net/core/fib_rules.c
> > > @@ -371,7 +371,8 @@ static int call_fib_rule_notifiers(struct net *net,
> > > .rule = rule,
> > > };
> > >
> > > - ASSERT_RTNL();
> > > + ASSERT_RTNL_NET(net);
> >
> > This warning will then fire in the vrf case, because vrf_fib_rule() is
> > only holding the real RTNL,
> > but not yet the net->rtnl_mutex ?
>
> As it's RTM_NEWLINK, dev_net(net)'s per-netns RTNL is held here and
> vrf_fib_rule() sets skb->sk = dev_net(dev)->rtnl, so I think it won't fire.
Yes, I believe you're correct. I ran fib_rule_tests.sh with a debug
config and CONFIG_DEBUG_NET_SMALL_RTNL=y and didn't see any splats.
BTW, did you consider adding this config option to
kernel/configs/debug.config under "Networking Debugging"?
next prev parent reply other threads:[~2025-02-06 11:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 8:46 [PATCH v1 net-next 0/6] fib: rules: Convert RTM_NEWRULE and RTM_DELRULE to per-netns RTNL Kuniyuki Iwashima
2025-02-06 8:46 ` [PATCH v1 net-next 1/6] fib: rules: Don't check net in rule_exists() and rule_find() Kuniyuki Iwashima
2025-02-06 8:46 ` [PATCH v1 net-next 2/6] fib: rules: Pass net to fib_nl2rule() instead of skb Kuniyuki Iwashima
2025-02-06 8:46 ` [PATCH v1 net-next 3/6] fib: rules: Split fib_nl2rule() Kuniyuki Iwashima
2025-02-06 8:46 ` [PATCH v1 net-next 4/6] fib: rules: Convert RTM_NEWRULE to per-netns RTNL Kuniyuki Iwashima
2025-02-06 8:46 ` [PATCH v1 net-next 5/6] fib: rules: Add error_free label in fib_nl_delrule() Kuniyuki Iwashima
2025-02-06 8:46 ` [PATCH v1 net-next 6/6] fib: rules: Convert RTM_DELRULE to per-netns RTNL Kuniyuki Iwashima
2025-02-06 9:41 ` Eric Dumazet
2025-02-06 9:52 ` Kuniyuki Iwashima
2025-02-06 11:22 ` Ido Schimmel [this message]
2025-02-07 4:12 ` Kuniyuki Iwashima
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z6SbdEENQ9Qku6av@shredder \
--to=idosch@idosch.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=kuniyu@amazon.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox