diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 2a78d54..428eb34 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -732,7 +732,8 @@ static struct lock_class_key qdisc_rx_lock; */ static struct Qdisc * -qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue, +qdisc_create(struct net_device *dev, struct Qdisc *p, + struct netdev_queue *dev_queue, u32 parent, u32 handle, struct nlattr **tca, int *errp) { int err; @@ -810,8 +811,9 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue, if (tca[TCA_RATE]) { spinlock_t *root_lock; - if ((sch->parent != TC_H_ROOT) && - !(sch->flags & TCQ_F_INGRESS)) + if (((sch->parent != TC_H_ROOT) && + !(sch->flags & TCQ_F_INGRESS)) && + (!p || !p->ops->attach)) root_lock = qdisc_root_sleeping_lock(sch); else root_lock = qdisc_lock(sch); @@ -1097,7 +1099,7 @@ create_n_graft: if (!(n->nlmsg_flags&NLM_F_CREATE)) return -ENOENT; if (clid == TC_H_INGRESS) - q = qdisc_create(dev, &dev->rx_queue, + q = qdisc_create(dev, p, &dev->rx_queue, tcm->tcm_parent, tcm->tcm_parent, tca, &err); else { @@ -1106,7 +1108,7 @@ create_n_graft: if (p && p->ops->cl_ops && p->ops->cl_ops->select_queue) ntx = p->ops->cl_ops->select_queue(p, tcm); - q = qdisc_create(dev, netdev_get_tx_queue(dev, ntx), + q = qdisc_create(dev, p, netdev_get_tx_queue(dev, ntx), tcm->tcm_parent, tcm->tcm_handle, tca, &err); }