提交 ddca33c5 编写于 作者: W Wang ShaoBo 提交者: Yang Yingliang

arm64/mpam: Supplement err tips in info/last_cmd_status

hulk inclusion
category: bugfix
bugzilla: 34588
CVE: NA

-----------------------------------------------

In many cases writing resctrl interface may return failure, but
err tips in info/last_cmd_status remain ok.
e.g.
    > echo 'L3:5=7fff' > schemata
      -bash: echo: write error: Invalid argument
    > cat info/last_cmd_status
      ok
    > cat ctrlmon
      1
    > echo 1 > ctrlmon
      -bash: echo: write error: No such file or directory
    > cat info/last_cmd_status
      ok
We add extra tips when goes to this branches.
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 78e49379
......@@ -863,7 +863,7 @@ static int resctrl_num_mon_show(struct kernfs_open_file *of,
int cpus_mon_write(struct rdtgroup *rdtgrp, cpumask_var_t newmask,
cpumask_var_t tmpmask)
{
pr_info("unsupported on mon_groups, please use ctrlmon groups\n");
rdt_last_cmd_puts("temporarily unsupported write cpus on mon_groups\n");
return -EINVAL;
}
......@@ -1148,6 +1148,7 @@ static ssize_t resctrl_group_ctrlmon_write(struct kernfs_open_file *of,
if (!rdtgrp) {
ret = -ENOENT;
rdt_last_cmd_puts("directory was removed\n");
goto unlock;
}
......@@ -1161,6 +1162,10 @@ static ssize_t resctrl_group_ctrlmon_write(struct kernfs_open_file *of,
if (!ret)
rdtgrp->flags |= RDT_CTRLMON;
} else {
if (ctrlmon)
rdt_last_cmd_printf("ctrlmon has been enabled\n");
else
rdt_last_cmd_printf("ctrlmon has been disabled\n");
ret = -ENOENT;
}
......
......@@ -175,6 +175,9 @@ static int parse_line(char *line, struct resctrl_resource *r)
goto next;
}
}
rdt_last_cmd_printf("unknown domain (%lu)\n", dom_id);
return -EINVAL;
}
......@@ -228,6 +231,7 @@ ssize_t resctrl_group_schemata_write(struct kernfs_open_file *of,
rdtgrp = resctrl_group_kn_lock_live(of->kn);
if (!rdtgrp) {
resctrl_group_kn_unlock(of->kn);
rdt_last_cmd_puts("directory was removed\n");
return -ENOENT;
}
rdt_last_cmd_clear();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册