From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44F20352FC1; Tue, 26 Aug 2025 14:21:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756218084; cv=none; b=QiQzhmqTFjuugS+Buq6EDIwKhdrDpa5AdzdP+Z6l5a+uGrMBDNqEDs+2ASESfIXak4CiD9Y532FHf1YxnnbKzDNpTisWPgKYgXGHZcO3O17SamMjy97aS86J5e+Cy/Ziua1KdQU6H2trmGbL/1fA49RrnlbX/uUJcHOWZ/YXn2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756218084; c=relaxed/simple; bh=qXR8XAuHfgrP1IAXewDzkNYGZj9fPLFk+fIjU7bmOJs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pS0N9ofP5MjM9Zpadg4ck8fX29mXmL8cUlG6Wo45o7MdLIxZT5XNAxDfM6b3VRx/m3uEhC8Ffz7j2vV8SOrR0s7mkGp5wU6nKDy0kRjooDRjEHy8x5RIYuubIDWvSb6AchsMFJ3O5lAlAtblL/67OpSnUAhnGaLgYM2U/LxvdNI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QSaWHj9A; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QSaWHj9A" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68B29C16AAE; Tue, 26 Aug 2025 14:21:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756218082; bh=qXR8XAuHfgrP1IAXewDzkNYGZj9fPLFk+fIjU7bmOJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QSaWHj9AhIZpKZ+EeLPByx+AnifKvG4TiU9khT20tB2P9xTtlV1Z3RiTrXDHxCvX7 JJ1k+olc7IGtZWWA3rhm7T+IhDP0or/0NpGnm6XuuZrtMEoVm9HiHDV5FZ8yzc89Y+ RTg5lDAV7UGjYEaBrgNYULgDiMKrj7NjOlAdoPDY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gerrard Tai , Cong Wang , Simon Horman , Jamal Hadi Salim , Paolo Abeni , Siddh Raman Pant Subject: [PATCH 5.10 387/523] sch_drr: make drr_qlen_notify() idempotent Date: Tue, 26 Aug 2025 13:09:57 +0200 Message-ID: <20250826110934.004343773@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110924.562212281@linuxfoundation.org> References: <20250826110924.562212281@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cong Wang commit df008598b3a00be02a8051fde89ca0fbc416bd55 upstream. drr_qlen_notify() always deletes the DRR class from its active list with list_del(), therefore, it is not idempotent and not friendly to its callers, like fq_codel_dequeue(). Let's make it idempotent to ease qdisc_tree_reduce_backlog() callers' life. Also change other list_del()'s to list_del_init() just to be extra safe. Reported-by: Gerrard Tai Signed-off-by: Cong Wang Reviewed-by: Simon Horman Link: https://patch.msgid.link/20250403211033.166059-3-xiyou.wangcong@gmail.com Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni Signed-off-by: Siddh Raman Pant Signed-off-by: Greg Kroah-Hartman --- net/sched/sch_drr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c @@ -111,6 +111,7 @@ static int drr_change_class(struct Qdisc if (cl == NULL) return -ENOBUFS; + INIT_LIST_HEAD(&cl->alist); cl->common.classid = classid; cl->quantum = quantum; cl->qdisc = qdisc_create_dflt(sch->dev_queue, @@ -234,7 +235,7 @@ static void drr_qlen_notify(struct Qdisc { struct drr_class *cl = (struct drr_class *)arg; - list_del(&cl->alist); + list_del_init(&cl->alist); } static int drr_dump_class(struct Qdisc *sch, unsigned long arg, @@ -401,7 +402,7 @@ static struct sk_buff *drr_dequeue(struc if (unlikely(skb == NULL)) goto out; if (cl->qdisc->q.qlen == 0) - list_del(&cl->alist); + list_del_init(&cl->alist); bstats_update(&cl->bstats, skb); qdisc_bstats_update(sch, skb); @@ -442,7 +443,7 @@ static void drr_reset_qdisc(struct Qdisc for (i = 0; i < q->clhash.hashsize; i++) { hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { if (cl->qdisc->q.qlen) - list_del(&cl->alist); + list_del_init(&cl->alist); qdisc_reset(cl->qdisc); } }