提交 c2cd5ee3 编写于 作者: W Wang ShaoBo 提交者: Zheng Zengkai

arm64/mpam: resctrl: add tips when rmid modification failed

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4LMMF
CVE: NA

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

This adds tips when rmid modification failed.

Fixes: a85aba6a ("mpam: Add support for group rmid modify")
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 bc9e3f98
...@@ -1848,12 +1848,14 @@ static ssize_t resctrl_group_rmid_write(struct kernfs_open_file *of, ...@@ -1848,12 +1848,14 @@ static ssize_t resctrl_group_rmid_write(struct kernfs_open_file *of,
if (rmid == 0 || rdtgrp->mon.rmid == 0) { if (rmid == 0 || rdtgrp->mon.rmid == 0) {
ret = -EINVAL; ret = -EINVAL;
rdt_last_cmd_puts("default rmid 0 is always kept\n");
goto unlock; goto unlock;
} }
ret = rmid_to_partid_pmg(rmid, &partid, &pmg); ret = rmid_to_partid_pmg(rmid, &partid, &pmg);
if (ret < 0) { if (ret < 0) {
ret = -EINVAL; ret = -EINVAL;
rdt_last_cmd_puts("invalid rmid\n");
goto unlock; goto unlock;
} }
...@@ -1862,6 +1864,7 @@ static ssize_t resctrl_group_rmid_write(struct kernfs_open_file *of, ...@@ -1862,6 +1864,7 @@ static ssize_t resctrl_group_rmid_write(struct kernfs_open_file *of,
if (rdtgrp->type != RDTCTRL_GROUP || if (rdtgrp->type != RDTCTRL_GROUP ||
!list_empty(&rdtgrp->mon.crdtgrp_list)) { !list_empty(&rdtgrp->mon.crdtgrp_list)) {
ret = -EINVAL;
rdt_last_cmd_puts("unsupported operation\n"); rdt_last_cmd_puts("unsupported operation\n");
goto unlock; goto unlock;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册