Re: [PATCH] lib: objagg: Fix stats imbalance on hinted-parent error path
From: Jiri Pirko
Date: Fri Nov 06 2026 - 07:36:49 EST
Fri, Nov 06, 2026 at 10:55:58AM +0100, tongzhiwei@xxxxxxxxxxxxxxxxxxxx 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@xxxxxxxxxxxxxxxxxxxx>
Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>