From: ebiederm@xmission.com (Eric W. Biederman)
To: Francesco Ruggeri <fruggeri@aristanetworks.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>, Jiri Pirko <jiri@resnulli.us>,
Alexander Duyck <alexander.h.duyck@intel.com>,
Cong Wang <amwang@redhat.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] net: race condition when removing virtual net_device
Date: Fri, 13 Sep 2013 18:46:08 -0700 [thread overview]
Message-ID: <87d2ocrx9b.fsf@xmission.com> (raw)
In-Reply-To: CA+HUmGjEC8eXT7BHm20uVOagJQbsqO9VZjmGSgmUvnrtEH-JYw@mail.gmail.com
Francesco Ruggeri <fruggeri@aristanetworks.com> writes:
> On Thu, Sep 12, 2013 at 10:50 PM, Eric W. Biederman
> <ebiederm@xmission.com> wrote:
> To summarize your proposal:
> 1) Remove re-broadcasting of NETDEV_UNREGISTER and
> NETDEV_UNREGISTER_FINAL from netdev_wait_allrefs.
Forget that it isn't needed. It would be nice but since it doesn't
solve the entire problem let's not go there.
> 2) If unregistering a net_device causes unregistering of other virtual
> devices (eg veth, macvlan, vlan) then move the virtual devices to the
> namespace of the original net_device.
>
> I do have some concerns about both correctness and feasibility of this approach.
>
> About 2), namespace dependent operations triggered by unregistering
> the virtual devices (eg rt_flush_dev, dst_dev_event/dst_ifdown and
> probably more) would not be done in the namespaces where they should.
Yes they will. That is what dev_change_net_namespace does.
dev_change_net_namespace would not be correct if it did not do that.
Now dev_change_net_namespace is comparitively expensive so it may not be the
best approach but it is an approach that will work.
> I do urge you to take a second look at the approach that I proposed.
> All it does is make sure that a namespace loopback_dev is not removed
> until any devices unlisted from that namespace are also disposed of.
> That in turn prevents non-device pernet subsystems from exiting that
> namespace in ops_exit_list.
It was worth a second look. I can not find anything wrong with your
patch but I can not convince myself that it is correct either. The
moving around the loopback device in the net dev todo list to prevent
deadlock I can't imagine why you are doing that.
I think I would prefer something more explicit and less likely to break.
Perhaps something that keeps a network namespace from exiting while we
delete devices. Using the loopback device like that looks fragile.
However it is very true that we require the loopback device to stay
around until all of the dst_ifdown calls in a network namespace are
made.
At least my original concern that you could be incrementing the count on
the loop back device when it had already reached zero can't be the case.
It would be very nice to have something that I could think through
easily and was robust to change.
Eric
next prev parent reply other threads:[~2013-09-14 1:46 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1379008796-2121-1-git-send-email-fruggeri@aristanetworks.com>
2013-09-12 20:06 ` [PATCH 1/1] net: race condition when removing virtual net_device Eric W. Biederman
2013-09-12 21:48 ` Francesco Ruggeri
2013-09-12 22:02 ` Francesco Ruggeri
2013-09-13 5:50 ` Eric W. Biederman
2013-09-13 17:54 ` Francesco Ruggeri
2013-09-14 1:46 ` Eric W. Biederman [this message]
2013-09-16 2:54 ` Francesco Ruggeri
2013-09-16 10:45 ` Eric W. Biederman
2013-09-16 20:30 ` Francesco Ruggeri
2013-09-16 23:52 ` [PATCH net-next] net loopback: Set loopback_dev to NULL when freed Eric W. Biederman
2013-09-17 0:50 ` Eric Dumazet
2013-09-17 1:34 ` David Miller
2013-09-17 1:41 ` Eric Dumazet
2013-09-17 1:52 ` Eric W. Biederman
2013-09-17 23:05 ` David Miller
2013-09-17 0:25 ` [PATCH 1/1] net: race condition when removing virtual net_device Eric W. Biederman
2013-09-17 5:12 ` Francesco Ruggeri
2013-09-17 3:49 ` [CFT][PATCH] net: Delay default_device_exit_batch until no devices are unregistering Eric W. Biederman
2013-09-17 6:54 ` Francesco Ruggeri
2013-09-17 9:38 ` Eric W. Biederman
2013-09-17 17:14 ` Francesco Ruggeri
2013-09-17 23:21 ` David Miller
2013-09-17 23:41 ` Eric W. Biederman
2013-09-18 0:15 ` David Miller
2013-09-18 3:50 ` Francesco Ruggeri
2013-09-18 3:52 ` David Miller
2013-09-18 8:19 ` Eric W. Biederman
2013-09-20 16:34 ` Francesco Ruggeri
2013-09-24 4:19 ` [PATCH] net: Delay default_device_exit_batch until no devices are unregistering v2 Eric W. Biederman
2013-09-24 17:54 ` Francesco Ruggeri
2013-09-28 22:14 ` David Miller
2013-09-14 0:16 ` [PATCH 1/1] net: race condition when removing virtual net_device David Miller
2013-09-14 1:32 ` Eric W. Biederman
2013-09-09 23:15 Francesco Ruggeri
2013-09-10 0:57 ` Stephen Hemminger
2013-09-10 2:03 ` Francesco Ruggeri
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=87d2ocrx9b.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=alexander.h.duyck@intel.com \
--cc=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fruggeri@aristanetworks.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.