* [PATCH] lib: objagg: Fix stats imbalance on hinted-parent error path
@ 2026-11-06 9:55 tongzhiwei
2026-11-06 12:31 ` Jiri Pirko
2026-11-27 7:14 ` [PATCH net-next v2] " tongzhiwei
0 siblings, 2 replies; 4+ messages in thread
From: tongzhiwei @ 2026-11-06 9:55 UTC (permalink / raw)
To: Jiri Pirko, Andrew Morton; +Cc: tongzhiwei, linux-kernel, netdev
NOTE: this commit is worked by llm completely
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().
Assisted-by: LLM
Signed-off-by: tongzhiwei <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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] lib: objagg: Fix stats imbalance on hinted-parent error path
2026-11-06 9:55 [PATCH] lib: objagg: Fix stats imbalance on hinted-parent error path tongzhiwei
@ 2026-11-06 12:31 ` Jiri Pirko
2026-11-27 7:14 ` [PATCH net-next v2] " tongzhiwei
1 sibling, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2026-11-06 12:31 UTC (permalink / raw)
To: tongzhiwei; +Cc: Andrew Morton, linux-kernel, netdev
Fri, Nov 06, 2026 at 10:55:58AM +0100, tongzhiwei@cmss.chinamobile.com wrote:
>NOTE: this commit is worked by llm completely
>
>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().
>
>Assisted-by: LLM
>Signed-off-by: tongzhiwei <tongzhiwei@cmss.chinamobile.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next v2] lib: objagg: Fix stats imbalance on hinted-parent error path
2026-11-06 9:55 [PATCH] lib: objagg: Fix stats imbalance on hinted-parent error path tongzhiwei
2026-11-06 12:31 ` Jiri Pirko
@ 2026-11-27 7:14 ` tongzhiwei
2026-12-04 5:00 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: tongzhiwei @ 2026-11-27 7:14 UTC (permalink / raw)
To: Jiri Pirko, Andrew Morton; +Cc: tongzhiwei, linux-kernel, netdev, Jiri Pirko
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v2] lib: objagg: Fix stats imbalance on hinted-parent error path
2026-11-27 7:14 ` [PATCH net-next v2] " tongzhiwei
@ 2026-12-04 5:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-12-04 5:00 UTC (permalink / raw)
To: tongzhiwei; +Cc: jiri, akpm, linux-kernel, netdev, jiri
Hello:
This patch was applied to netdev/net-next.git (main)
by Willem de Bruijn <willemb@google.com>:
On Fri, 27 Nov 2026 15:14:45 +0800 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [net-next,v2] lib: objagg: Fix stats imbalance on hinted-parent error path
https://git.kernel.org/netdev/net-next/c/9f21f1f7c311
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] 4+ messages in thread
end of thread, other threads:[~2026-12-04 5:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 9:55 [PATCH] lib: objagg: Fix stats imbalance on hinted-parent error path tongzhiwei
2026-11-06 12:31 ` Jiri Pirko
2026-11-27 7:14 ` [PATCH net-next v2] " tongzhiwei
2026-12-04 5:00 ` 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