Re: [PATCH] lib: objagg: Fix stats imbalance on hinted-parent error path

From
Jiri Pirko <jiri@resnulli.us>
Date
2026-11-06 12:31:20
Also in
lkml
Reply to
tongzhiwei, 2026-11-06
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 <redacted>
Reviewed-by: Jiri Pirko <redacted>
Thread (2 messages) 2 messages, 2 authors, last reply 10d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help