Article View: linux.kernel.netdev
Article #23387[PATCH net-next v2] lib: objagg: Fix stats imbalance on hinted-parent error path
From: tongzhiwei
Date: Fri, 27 Nov 2026 07:14
Date: Fri, 27 Nov 2026 07:14
62 lines
10926 bytes
10926 bytes
This issue was discovered by an AI code review agent during static
inspection of the hinted-parent error path. It has not been
triggered or observed at runtime; the analysis was confirmed by
inspecting the code, pairing __objagg_obj_get() with
__objagg_obj_put() on the success path. The fix has not been
runtime-tested. Its only build validation is the automated netdev
build tests run on the v1 submission (identical diff), which passed
with no new warnings. The fix and this commit message were
prepared by the same LLM agent and reviewed by the human submitter.
In objagg_obj_init_with_hints(), the parent is obtained via
__objagg_obj_get() which increments only the refcount without
touching stats. The matching release for internal references is
__objagg_obj_put() (no stats adjustment), as used in the success
path in objagg_obj_parent_unassign().
However, the error cleanup at err_parent_assign calls the public
objagg_obj_put(), which additionally runs objagg_obj_stats_dec(),
decrementing user_count and delta_user_count with no prior
increment. This corrupts the parent stats, leading to
under-reporting and potential user_count underflow.
Use __objagg_obj_put() to match the internal __objagg_obj_get().
Fixes: 9069a3817d82 ("lib: objagg: implement optimization hints assembly and use hints for object creation")
Signed-off-by: tongzhiwei <tongzhiwei@cmss.chinamobile.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
---
V1 -> V2:
- add the net-next tree designation to the subject
- add the Fixes: tag for the commit that introduced the
hinted-parent error path
- collect the Reviewed-by tag from Jiri Pirko. Thank you for the
review, and sorry for the slow follow-up! The diff is unchanged,
so the tag is carried over as-is
- replace the "NOTE: this commit is worked by llm completely" line
and the "Assisted-by: LLM" trailer with the plain-English
discovery and testing statement above, per the "Bug fixes"
section of Documentation/process/maintainer-netdev.rst
- no code changes
v1: https://lore.kernel.org/r/20261106095621.143-1-tongzhiwei@cmss.chinamobile.com/
lib/objagg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/objagg.c b/lib/objagg.c
index 23c7105a3f9f..6c4144213eb8 100644
--- a/lib/objagg.c
+++ b/lib/objagg.c
@@ -327,7 +327,7 @@ static int objagg_obj_init_with_hints(struct objagg *objagg,
return 0;
err_parent_assign:
- objagg_obj_put(objagg, parent);
+ __objagg_obj_put(objagg, parent);
return err;
}
--
2.43.0
Technical Details
Message-ID:
<20261127071449.551-1-tongzhiwei@cmss.chinamobile.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372514-linux-kernel-netdev=dewy.ruReferences:
<20261106095621.143-1-tongzhiwei@cmss.chinamobile.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372514-linux-kernel-netdev=dewy.ru From: tongzhiwei@cmss.chinamobile.com (tongzhiwei) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v2] lib: objagg: Fix stats imbalance on hinted-parent error path Date: Fri, 27 Nov 2026 15:14:45 +0800 Organization: Usenet Network Message-ID: <20261127071449.551-1-tongzhiwei@cmss.chinamobile.com> References: <20261106095621.143-1-tongzhiwei@cmss.chinamobile.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="667887"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:hVT4+Ri9HaMrgE/6j+gws4VNoQA= sha256:R2boixcsBMmn6P/jwOk2tk/oPoVe4KpxVtodMYsbFyw= sha1:BRAx3+GZa4DAMNgDfD+OVmyd0hg= sha256:HaR4JQpET5CVSGJVtQYoCZ3NL7bhwNp5lKqE3hPkRV4= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 1D8D0125F12; Fri, 27 Nov 2026 10:15:34 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.751 X-Spam-Status: No, score=-2.751 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=fail (1024-bit key) reason="fail (body has been altered)" header.d=cmss.chinamobile.com X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M55CecidVviq; Fri, 27 Nov 2026 10:15:29 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372514-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=cmss.chinamobile.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 2578F125F11; Fri, 27 Nov 2026 10:15:20 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id D03FA2CBD3; Fri, 27 Nov 2026 07:15:16 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795763716; b=ti8B7QX1dKJ4qzfnmNSiWKaK+9q2c7vC1S7zS6vcTHnhjkt0N3YhvnvI3WTsZETfVLrM bhjcno1hLxELNndVIOUgvoSsrgZIzMJFVXN+OSCOKbTvAI+XWaI63yxgm1frZ0ddkerYL 6xbBAAnX0oCY7lWNylb19xfpp7IW+MTyGiVz7Xo8JbHOW7ckOK/+t0zAkW7s//49uc4Qb yJla7oHQNpC3DDh4lRPxixnPtb6Gc74qMJi+aAK7esPw1j+PtA84pBKFaR9XDlV+KCF1G eYdmVJfxfl3f7vOMYp64tkECGofsPUYNiG43ERmDfHJhAX2z16nOTe6IjWy80eVQl4A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795763716; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:X-RM-TagInfo: X-RM-SPAM-FLAG:Received:X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG: Received:X-RM-TRANSID:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=sdHeVGtyJhV98HK8k0GuhRxGfmBtLYuJT4oh96DWm9U=; b=eNRgf65mBMQ6+8ZwsTpQuO2Hzivl++HbWKwypydnz/TvBSbcPZokbWOcsl40jK59mTbc 7JdS+6pH2ji5lBYabdgFr14FAIUouV1C6l+mP4q9dWHIO4RtkXlkEdxfxU58IKUif4XHi +gitA4wACBiXwmjAkgvhmbHDITvm3Jsrlf9KF9MUxmD85o8v4FAJFK/BV4LdRUNGAY8ze A1mBOKKE5Uzn/g7nb90/tWcY7PeMJyidpvRcVtoEn5cwY9Ivuj3xt5Jm+/onIz+T26zo5 6XzRIaPX40CfaMTfErs4dDDAjBlAweeOMhQ9yL87JdVESbD9pTAcyey5XzV/fCPlE5g== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=kVacH+FV; dmarc=pass header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5BB3606A32D; Fri, 27 Nov 2026 07:15:16 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=kVacH+FV X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=111.22.67.151 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795763708; b=QImrFqsRFJzL8mwj2FJFY5XjcaZoCryXLrcoHTNZqwG4aYqemyI8sIacYL1Zf9nGD02Y GUyXS42c4JFSz4asQjlJanP+erLDAMQizJRUkvy2T/E6dlxAujl1y/kEzKqk2BU6q1nqf PPec5iuez1VUMT0+XE3tqtzIoTUumyudVrV0SE3Sx1Tm3os7h1Y26vGKs993xrnr7pajZ 2YEg0AyDoIkmJJH1ZrzSxMfHOp5mJ1VWTZ2CMxEFaVav+3J+lXSyMSY2GfLV9rucz0H+7 JKoevftbqB6Yfniyia+8zmjeRW8PrqiJ96dBq2W6t+vKhlNlFfsbFBMul8oJKwNNbEg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795763708; h=DMARC-Filter:DKIM-Signature:X-RM-TagInfo:X-RM-SPAM-FLAG:Received: X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:X-RM-TRANSID:From: To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=sdHeVGtyJhV98HK8k0GuhRxGfmBtLYuJT4oh96DWm9U=; b=Z7f4Ew06hwkZcvvxTZ7m3FHoXo2AWNLHg2N8WBLeyna86fCdMs1WeqJ2dwBbq45O2yG+ XG8rIFqf9wcuF0f6f7n64u1Nd6xbuqqFUuUT9jRy/3jdaSRBPMyt8ooehxlzz2sKSvz/i CNgUUPQCicvc12Y/ZYXlx87KpLTfKOiieAv4Pg6iTooYjmsNVlDWa7Mulv3fgwhYGIs9E PyZVzU7MgWzwm3JnnqdJu0VQ2X8qGsea/7Gkyr7HJj7Qtn9+qvQ9McxLnjqbpyacYmKaE hlHeDQiQyIFPBkqq246+I/alh/qaXxpqabWkbTYe0jCrZTstiKTublgGGd9zfkT1TnA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=kVacH+FV; arc=none smtp.remote-ip=111.22.67.151 X-Received: from cmccmta8.chinamobile.com (cmccmta8.chinamobile.com [111.22.67.151]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91892606A324; Fri, 27 Nov 2026 07:15:04 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 91892606A324 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmss.chinamobile.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmss.chinamobile.com; s=default; l=0; h=from:subject:message-id:to:cc:mime-version; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=kVacH+FV8yfpcKk8v/nyGFqL8DYtZHeWDGJJA0MXeowJL612xIt0KD2ncuUAQvgfZPHdNDTjkiL9b caSoaVzncnM3o+1ImTQmgINmUKTjAJNqsicHqmOlRjkmDdtM9cibdSzHDtaYx9y2904aGNJ3OxNbCU 8HiJldf4zFkOcCyo= X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app02-12002 (RichMail) with SMTP id 2ee26b092df60bd-9fa18; Fri, 27 Nov 2026 15:15:02 +0800 (CST) X-RM-TRANSID: 2ee26b092df60bd-9fa18 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-Received: from localhost.localdomain (unknown[10.55.1.72]) by rmsmtp-syy-appsvr07-12007 (RichMail) with SMTP id 2ee76b092df40d7-8acc7; Fri, 27 Nov 2026 15:15:02 +0800 (CST) X-RM-TRANSID: 2ee76b092df40d7-8acc7 X-Cc: tongzhiwei@cmss.chinamobile.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Jiri Pirko <jiri@nvidia.com> X-Mailer: git-send-email 2.45.0.windows.1 X-In-Reply-To: <20261106095621.143-1-tongzhiwei@cmss.chinamobile.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list