Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dacb6646 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net/sched: fix race between deactivation and dequeue for NOLOCK qdisc"

parents 481ec87c e786a31c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -117,7 +117,13 @@ void __qdisc_run(struct Qdisc *q);
static inline void qdisc_run(struct Qdisc *q)
{
	if (qdisc_run_begin(q)) {
		/* NOLOCK qdisc must check 'state' under the qdisc seqlock
		 * to avoid racing with dev_qdisc_reset()
		 */
		if (!(q->flags & TCQ_F_NOLOCK) ||
		    likely(!test_bit(__QDISC_STATE_DEACTIVATED, &q->state)))
			__qdisc_run(q);

		qdisc_run_end(q);
	}
}
+2 −7
Original line number Diff line number Diff line
@@ -3449,13 +3449,8 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
	qdisc_calculate_pkt_len(skb, q);

	if (q->flags & TCQ_F_NOLOCK) {
		if (unlikely(test_bit(__QDISC_STATE_DEACTIVATED, &q->state))) {
			__qdisc_drop(skb, &to_free);
			rc = NET_XMIT_DROP;
		} else {
		rc = q->enqueue(skb, q, &to_free) & NET_XMIT_MASK;
		qdisc_run(q);
		}

		if (unlikely(to_free))
			kfree_skb_list(to_free);