mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
pkt_sched: Fix gen_estimator locks
While passing a qdisc root lock to gen_new_estimator() and gen_replace_estimator() dev could be deactivated or even before grafting proper root qdisc as qdisc_sleeping (e.g. qdisc_create), so using qdisc_root_lock() is not enough. This patch adds qdisc_root_sleeping_lock() for this, plus additional checks, where necessary. Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f7a54c13c7
commit
f6f9b93f16
5 changed files with 25 additions and 9 deletions
|
@ -217,6 +217,14 @@ static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc)
|
|||
return qdisc_lock(root);
|
||||
}
|
||||
|
||||
static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc)
|
||||
{
|
||||
struct Qdisc *root = qdisc_root_sleeping(qdisc);
|
||||
|
||||
ASSERT_RTNL();
|
||||
return qdisc_lock(root);
|
||||
}
|
||||
|
||||
static inline struct net_device *qdisc_dev(struct Qdisc *qdisc)
|
||||
{
|
||||
return qdisc->dev_queue->dev;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue