diff options
author | Eric Dumazet <edumazet@google.com> | 2021-10-19 02:34:01 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-20 00:40:50 +0200 |
commit | 4c57e2fac41cefa49583b9836677e5b59cbe9f64 (patch) | |
tree | f7d660ca2b9736a190cb47983e7b95d3ebb2302c /include/net/sch_generic.h | |
parent | net: ethernet: ixp4xx: Make use of dma_pool_zalloc() instead of dma_pool_allo... (diff) | |
download | linux-4c57e2fac41cefa49583b9836677e5b59cbe9f64.tar.xz linux-4c57e2fac41cefa49583b9836677e5b59cbe9f64.zip |
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>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r-- | include/net/sch_generic.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index baad2ab4d971..e0988c56dd8f 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -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) |