From: David Miller <davem@davemloft.net>
To: sowmini.varadhan@oracle.com
Cc: netdev@vger.kernel.org, dave.kleikamp@oracle.com,
dan.carpenter@oracle.com
Subject: Re: [PATCH net-next] sunvnet: call unregister_netdev() exactly once per device
Date: Tue, 08 Jul 2014 20:42:18 -0700 (PDT) [thread overview]
Message-ID: <20140708.204218.141082766724192890.davem@davemloft.net> (raw)
In-Reply-To: <20140708161827.GO19954@sowmini.varadhan@oracle.com>
From: sowmini.varadhan@oracle.com
Date: Tue, 8 Jul 2014 12:18:27 -0400
> unregister_netdev the parent net_device only after
> the last port in the port_list of a `struct vnet'
> is removed when the vnet is dismantled. Moreover,
> this should only be done if the net_device was
> successfully registered.
>
> Without this fix, 'modprobe -r sunvnet' could
> trigger the following in rollback_registered_many()
> 5693 BUG_ON(dev->reg_state != NETREG_REGISTERED);
>
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> Acked-by: Dave Kleikamp <dave.kleikamp@oracle.com>
> Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
This is definitely not the right fix, you're just removing a symptom
of a much larger problem.
And that problem is that nothing cleans up the objects created by
vnet_new(), they are completely leaked.
vnet_exit(), after doing the vio_unregister_driver(), should call a
helper function that iterates over vnet_list and cleans up those
objects.
That's where the unregister_netdevice() belongs, not in vnet_port_remove().
next parent reply other threads:[~2014-07-09 3:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140708161827.GO19954@sowmini.varadhan@oracle.com>
2014-07-09 3:42 ` David Miller [this message]
2014-07-09 11:27 ` [PATCH net-next] sunvnet: call unregister_netdev() exactly once per device Sowmini Varadhan
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=20140708.204218.141082766724192890.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dan.carpenter@oracle.com \
--cc=dave.kleikamp@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=sowmini.varadhan@oracle.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).