[ovs-dev] [PATCH 2/2] veth: Do a better job cleaning up on rmmod

Jesse Gross jesse at nicira.com
Thu Apr 22 16:43:28 UTC 2010


On Wed, Apr 21, 2010 at 8:26 PM, Justin Pettit <jpettit at nicira.com> wrote:

> On Apr 21, 2010, at 7:46 AM, Jesse Gross wrote:
>
> > On Wed, Apr 21, 2010 at 1:50 AM, Justin Pettit <jpettit at nicira.com>
> wrote:
> >  static __exit void veth_exit(void)
> >  {
> > +       struct veth_priv *p, *n;
> > +
> > +       rtnl_lock();
> > +       list_for_each_entry_safe(p, n, &veth_list, list) {
> > +               veth_dellink(p->dev);
> > +       }
> >
> > I don't think this is safe.  With the *_safe variants of functions it is
> OK to remove the current element but not necessarily arbitrary elements
> since they store the next list entry in n before returning p so you can
> delete p.  However, veth_dellink deletes both the link and its peer (which
> is probably the next entry).
>
> Please double-check me, but I don't think there's a problem.  While
> confusing, only the first device is added to that list:
>

You're right, I see that now.  Looks fine then.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20100422/78769d83/attachment-0003.html>


More information about the dev mailing list