Subject: Re: [PATCH v1] net/sched: sch_qfq: Avoid triggering might_sleep in atomic context in qfq_delete_class

From: Xiang Mei <[email-masked]>
Date: Fri, 18 Jul 2025 14:11:54 -0700

On Fri, Jul 18, 2025 at 10:43:22PM +0300, Dan Carpenter wrote:
> On Thu, Jul 17, 2025 at 04:01:28PM -0700, Xiang Mei wrote:
> > might_sleep could be trigger in the atomic context in qfq_delete_class.
> > 
> > qfq_destroy_class was moved into atomic context locked
> > by sch_tree_lock to avoid a race condition bug on
> > qfq_aggregate. However, might_sleep could be triggered by
> > qfq_destroy_class, which introduced sleeping in atomic context (path:
> > qfq_destroy_class->qdisc_put->__qdisc_destroy->lockdep_unregister_key
> > ->might_sleep).
> > 
> > Considering the race is on the qfq_aggregate objects, keeping
> > qfq_rm_from_agg in the lock but moving the left part out can solve
> > this issue.
> > 
> > Fixes: 5e28d5a3f774 ("net/sched: sch_qfq: Fix race condition on qfq_aggregate")
> > Reported-by: Dan Carpenter <[email-masked]>
> > Signed-off-by: Xiang Mei <[email-masked]>
> > Link: https://patch.msgid.link/[email-masked]
> > ---
> > v1: Avoid might_sleep in atomic context
> 
> No need for this line on the first version of a patch.  It's just to
> track changes between versions.
> 
> Anyway, looks good.  Thanks!
> 
> Reviewed-by: Dan Carpenter <[email-masked]>
> 
> regards,
> dan carpenter
> 
>
Thanks so much for the tip and both of your reviews.