[PATCH] fs/resctrl: Report why a schemata write failed

From: Jinjie Ruan

Date: Wed Nov 04 2026 - 05:29:37 EST


rdtgroup_schemata_write() clears last_cmd_status when it takes the group
lock, and records a message for the input errors it detects. When
resctrl_arch_update_domains() fails, the function returns the error to
userspace without recording anything, so last_cmd_status is empty and
its show function reports "ok".

resctrl_arch_update_domains() fails when the architecture code cannot
reach a domain, which on MPAM is a write to an MSC with no online CPU.
The error code is the only description of the failure available to an
administrator, and it never reaches last_cmd_status.

Record the resource name and the error where rdtgroup_schemata_write()
discards the return value, so that last_cmd_status reports the failure
instead of the previous success.

Only arm64 MPAM systems are affected today; x86's
resctrl_arch_update_domains() always returns 0.

Fixes: c377dcfbee80 ("x86/intel_rdt: Add diagnostics when writing the schemata file")
Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
---
fs/resctrl/ctrlmondata.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c
index cafebdff70dc..cfb59cbc4135 100644
--- a/fs/resctrl/ctrlmondata.c
+++ b/fs/resctrl/ctrlmondata.c
@@ -367,8 +367,11 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of,
continue;

ret = resctrl_arch_update_domains(r, rdtgrp->closid);
- if (ret)
+ if (ret) {
+ rdt_last_cmd_printf("%s: failed to update the domains: %pe\n",
+ r->name, ERR_PTR(ret));
goto out_clear_staged;
+ }
}

if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP) {
--
2.34.1