From: Stephen Hemminger <stephen.hemminger@vyatta.com>
To: David Miller <davem@davemloft.net>
Cc: kaber@trash.net, netdev@vger.kernel.org
Subject: [PATCH] net: trap attempts to modify noop qdisc
Date: Wed, 6 Aug 2008 23:08:50 -0700 [thread overview]
Message-ID: <20080806230850.41435290@extreme> (raw)
In-Reply-To: <20080806.202210.92821768.davem@davemloft.net>
Since noop qdisc is a singleton, it shouldn't end up with any other
qdisc's on it's list, and it shouldn't be deleted.
Dave, this should help you find the bug. Any change to root qdisc causes
this to trigger. I.e doing:
tc qdisc add dev eth0 root pfifo
causes pfifo to end up on the noop_qdisc->list, which later causes problems.
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 4840aff..57b778f 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -792,8 +792,10 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue,
goto err_out3;
}
}
- if (parent && !(sch->flags & TCQ_F_INGRESS))
+ if (parent && !(sch->flags & TCQ_F_INGRESS)) {
+ BUG_ON(dev_queue->qdisc == &noop_qdisc);
list_add_tail(&sch->list, &dev_queue->qdisc->list);
+ }
return sch;
}
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 7cf83b3..5988863 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -547,6 +547,8 @@ static void __qdisc_destroy(struct rcu_head *head)
void qdisc_destroy(struct Qdisc *qdisc)
{
+ BUG_ON(qdisc == &noop_qdisc);
+
if (qdisc->flags & TCQ_F_BUILTIN ||
!atomic_dec_and_test(&qdisc->refcnt))
return;
--
1.5.4.3
next prev parent reply other threads:[~2008-08-07 6:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-07 1:02 sfq dump broken in 2.6.27-rc1 Stephen Hemminger
2008-08-07 1:13 ` David Miller
2008-08-07 3:20 ` Stephen Hemminger
2008-08-07 3:22 ` David Miller
2008-08-07 6:08 ` Stephen Hemminger [this message]
2008-08-07 6:11 ` [PATCH] net: trap attempts to modify noop qdisc David Miller
2008-08-07 6:15 ` Stephen Hemminger
2008-08-07 6:18 ` David Miller
[not found] ` <20080806.233703.193701199.davem@davemloft.net>
2008-08-07 17:22 ` Stephen Hemminger
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=20080806230850.41435290@extreme \
--to=stephen.hemminger@vyatta.com \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--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 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).