From: Stephen Hemminger <shemminger@osdl.org>
To: Krishna Kumar <kumarkr@us.ibm.com>
Cc: davem@redhat.com, krkumar@us.ibm.com, netdev@oss.sgi.com
Subject: Re: [PATCH] panic during unregister_netdevice()
Date: Wed, 5 Nov 2003 17:09:15 -0800 [thread overview]
Message-ID: <20031105170915.14793157.shemminger@osdl.org> (raw)
In-Reply-To: <OF919647C5.E8CC7ED3-ON88256DD6.0003A8F5@us.ibm.com>
Try this. Instead of dropping the last reference in unregister, it does it
after all other references are gone (sort of like the old 2.4 code).
diff -Nru a/net/core/dev.c b/net/core/dev.c
--- a/net/core/dev.c Wed Nov 5 17:04:57 2003
+++ b/net/core/dev.c Wed Nov 5 17:04:57 2003
@@ -2743,7 +2743,7 @@
unsigned long rebroadcast_time, warning_time;
rebroadcast_time = warning_time = jiffies;
- while (atomic_read(&dev->refcnt) != 0) {
+ while (atomic_read(&dev->refcnt) > 1) {
if (time_after(jiffies, rebroadcast_time + 1 * HZ)) {
rtnl_shlock();
rtnl_exlock();
@@ -2838,6 +2838,7 @@
dev->reg_state = NETREG_UNREGISTERED;
netdev_wait_allrefs(dev);
+ dev_put(dev);
/* paranoia */
BUG_ON(atomic_read(&dev->refcnt));
@@ -2974,7 +2975,6 @@
/* Finish processing unregister after unlock */
net_set_todo(dev);
- dev_put(dev);
return 0;
}
next prev parent reply other threads:[~2003-11-06 1:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-06 0:42 [PATCH] panic during unregister_netdevice() Krishna Kumar
2003-11-06 1:09 ` Stephen Hemminger [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-11-06 19:58 Krishna Kumar
2003-11-06 19:59 ` David S. Miller
2003-11-06 21:07 ` Krishna Kumar
2003-11-06 21:14 ` David S. Miller
2003-11-06 1:42 Krishna Kumar
2003-11-06 1:20 Krishna Kumar
2003-11-06 1:33 ` Stephen Hemminger
2003-11-06 1:16 Krishna Kumar
2003-11-06 0:26 Krishna Kumar
2003-11-06 0:00 Krishna Kumar
2003-11-06 0:30 ` Stephen Hemminger
2003-11-06 0:33 ` David S. 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=20031105170915.14793157.shemminger@osdl.org \
--to=shemminger@osdl.org \
--cc=davem@redhat.com \
--cc=krkumar@us.ibm.com \
--cc=kumarkr@us.ibm.com \
--cc=netdev@oss.sgi.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).