Re: [PATCH] fs/resctrl: Free mon_data structures on rdt_get_tree() failure

From: Reinette Chatre

Date: Thu May 07 2026 - 16:46:52 EST


Hi Tony,

On 5/7/26 1:17 PM, Tony Luck wrote:
> diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
> index 5dfdaa6f9d8f..aad573b62fd7 100644
> --- a/fs/resctrl/rdtgroup.c
> +++ b/fs/resctrl/rdtgroup.c
> @@ -2879,8 +2879,10 @@ static int rdt_get_tree(struct fs_context *fc)
> out_psl:
> rdt_pseudo_lock_release();
> out_mondata:
> - if (resctrl_arch_mon_capable())
> + if (resctrl_arch_mon_capable()) {
> + mon_put_kn_priv();
> kernfs_remove(kn_mondata);
> + }
> out_mongrp:
> if (resctrl_arch_mon_capable()) {
> rdtgroup_unassign_cntrs(&rdtgroup_default);

>From what I can tell the other [1] fix will conflict here. To help manage dependencies
I thus think it will be simpler if these rdt_get_tree() fixes are grouped in the same
series.

Reinette

[1] https://lore.kernel.org/lkml/5d38c1fb-8f91-472b-8897-24b2f50c772b@xxxxxxxxx/