net: sched: fix logic error in qdisc_run_begin()
authorEric Dumazet <edumazet@google.com>
Tue, 19 Oct 2021 00:34:01 +0000 (17:34 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Oct 2021 22:40:50 +0000 (15:40 -0700)
commit4c57e2fac41cefa49583b9836677e5b59cbe9f64
treef7d660ca2b9736a190cb47983e7b95d3ebb2302c
parent05be94633783ffb3ad5b0aca7f6cff08cad6868d
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: 29cbcd858283 ("net: sched: Remove Qdisc::running sequence counter")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ahmed S. Darwish <a.darwish@linutronix.de>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/sch_generic.h