From: David Ahern <dsahern@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>, netdev@vger.kernel.org
Cc: jeffy.chen@rock-chips.com
Subject: Re: [Patch net] ipv6: only call ip6_route_dev_notify() once for NETDEV_UNREGISTER
Date: Tue, 20 Jun 2017 23:16:29 -0400 [thread overview]
Message-ID: <18b0fdf4-f967-9a04-91d6-597848f073a9@gmail.com> (raw)
In-Reply-To: <1497984147-15011-1-git-send-email-xiyou.wangcong@gmail.com>
On 6/20/17 2:42 PM, Cong Wang wrote:
> In commit 242d3a49a2a1 ("ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf")
> I assumed NETDEV_REGISTER and NETDEV_UNREGISTER are paired,
> unfortunately, as reported by jeffy, netdev_wait_allrefs()
> could rebroadcast NETDEV_UNREGISTER event until all refs are
> gone.
>
> We have to add an additional check to avoid this corner case.
> For netdev_wait_allrefs() dev->reg_state is NETREG_UNREGISTERED,
> for dev_change_net_namespace(), dev->reg_state is
> NETREG_REGISTERED. So check for dev->reg_state != NETREG_UNREGISTERED.
>
> Fixes: 242d3a49a2a1 ("ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf")
> Reported-by: jeffy <jeffy.chen@rock-chips.com>
> Cc: David Ahern <dsahern@gmail.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> ---
> net/ipv6/route.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
Acked-by: David Ahern <dsahern@gmail.com>
next prev parent reply other threads:[~2017-06-21 3:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-20 18:42 [Patch net] ipv6: only call ip6_route_dev_notify() once for NETDEV_UNREGISTER Cong Wang
2017-06-21 3:01 ` jeffy
2017-06-21 3:08 ` jeffy
2017-06-21 3:16 ` David Ahern [this message]
2017-06-22 15:07 ` David Miller
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=18b0fdf4-f967-9a04-91d6-597848f073a9@gmail.com \
--to=dsahern@gmail.com \
--cc=jeffy.chen@rock-chips.com \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.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;
as well as URLs for NNTP newsgroup(s).