Commit 4c57e2fa authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski
Browse files

net: sched: fix logic error in qdisc_run_begin()



For non TCQ_F_NOLOCK qdisc, qdisc_run_begin() tries to set
__QDISC_STATE_RUNNING and should return true if the bit was not set.

test_and_set_bit() returns old bit value, therefore we need to invert.

Fixes: 29cbcd85 ("net: sched: Remove Qdisc::running sequence counter")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Ahmed S. Darwish <a.darwish@linutronix.de>
Tested-by: default avatarIdo Schimmel <idosch@nvidia.com>
Acked-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 05be9463
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc)
		 */
		return spin_trylock(&qdisc->seqlock);
	}
	return test_and_set_bit(__QDISC_STATE_RUNNING, &qdisc->state);
	return !test_and_set_bit(__QDISC_STATE_RUNNING, &qdisc->state);
}

static inline void qdisc_run_end(struct Qdisc *qdisc)