diff options
author | Eric Dumazet <[email protected]> | 2021-10-18 17:34:01 -0700 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2021-10-19 15:40:50 -0700 |
commit | 4c57e2fac41cefa49583b9836677e5b59cbe9f64 (patch) | |
tree | f7d660ca2b9736a190cb47983e7b95d3ebb2302c | |
parent | 05be94633783ffb3ad5b0aca7f6cff08cad6868d (diff) |
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 <[email protected]>
Cc: Ahmed S. Darwish <[email protected]>
Tested-by: Ido Schimmel <[email protected]>
Acked-by: Sebastian Andrzej Siewior <[email protected]>
Tested-by: Toke Høiland-Jørgensen <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
-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) |