linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: sched: fix lockdep_set_class() typo error for sch->seqlock
@ 2021-08-03 10:58 Yunsheng Lin
  2021-08-04  9:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Yunsheng Lin @ 2021-08-03 10:58 UTC (permalink / raw)
  To: davem, kuba
  Cc: jhs, xiyou.wangcong, jiri, pabeni, ap420073, netdev,
	linux-kernel, linuxarm

According to comment in qdisc_alloc(), sch->seqlock's lockdep
class key should be set to qdisc_tx_busylock, due to possible
type error, sch->busylock's lockdep class key is set to
qdisc_tx_busylock, which is duplicated because sch->busylock's
lockdep class key is already set in qdisc_alloc().

So fix it by replacing sch->busylock with sch->seqlock.

Fixes: 96009c7d500e ("sched: replace __QDISC_STATE_RUNNING bit with a spin lock")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
---
commit ab92d68fc22f ("net: core: add generic lockdep keys")
seems to fix the above error without mentioning that, and then
it is reverted by commit 1a33e10e4a95 ("net: partially revert
dynamic lockdep key changes"), but the blamed commit still be
96009c7d500e ("sched: replace __QDISC_STATE_RUNNING bit with
a spin lock").
---
 net/sched/sch_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index d9ac60f..a8dd06c 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -913,7 +913,7 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
 
 	/* seqlock has the same scope of busylock, for NOLOCK qdisc */
 	spin_lock_init(&sch->seqlock);
-	lockdep_set_class(&sch->busylock,
+	lockdep_set_class(&sch->seqlock,
 			  dev->qdisc_tx_busylock ?: &qdisc_tx_busylock);
 
 	seqcount_init(&sch->running);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: sched: fix lockdep_set_class() typo error for sch->seqlock
  2021-08-03 10:58 [PATCH net] net: sched: fix lockdep_set_class() typo error for sch->seqlock Yunsheng Lin
@ 2021-08-04  9:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-04  9:10 UTC (permalink / raw)
  To: Yunsheng Lin
  Cc: davem, kuba, jhs, xiyou.wangcong, jiri, pabeni, ap420073, netdev,
	linux-kernel, linuxarm

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Tue, 3 Aug 2021 18:58:21 +0800 you wrote:
> According to comment in qdisc_alloc(), sch->seqlock's lockdep
> class key should be set to qdisc_tx_busylock, due to possible
> type error, sch->busylock's lockdep class key is set to
> qdisc_tx_busylock, which is duplicated because sch->busylock's
> lockdep class key is already set in qdisc_alloc().
> 
> So fix it by replacing sch->busylock with sch->seqlock.
> 
> [...]

Here is the summary with links:
  - [net] net: sched: fix lockdep_set_class() typo error for sch->seqlock
    https://git.kernel.org/netdev/net/c/06f5553e0f0c

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-04  9:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 10:58 [PATCH net] net: sched: fix lockdep_set_class() typo error for sch->seqlock Yunsheng Lin
2021-08-04  9:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).