x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system
PATCH 1/1 x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system
From: Wang Hui <[email protected]>
If no monitoring feature is detected because all monitoring features are disabled during boot time or there is no monitoring feature in hardware, creating rdtgroup sub-directory by "mkdir" command reports error:
#mkdir /sys/fs/resctrl/p1
mkdir: cannot create directory ‘/sys/fs/resctrl/p1’: No such file or directory
But the sub-directory actually is generated and content is correct:
#ls /sys/fs/resctrl/p1
cpus cpus_list schemata tasks
The error is because rdtgroup_mkdir_ctrl_mon() returns non zero value after the sub-directory is created and the returned value is reported as an error to user.
Clear the returned value to report to user that the sub-directory is actually created successfully.
--- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +1 -0
@@ -1804,6 +1804,7 @@ static int rdtgroup_mkdir_ctrl_mon(struct kernfs_node *parent_kn, goto out_common_fail; } closid = ret; + ret =0 ; rdtgrp->closid = closid;list_add (&rdtgrp->rdtgroup_list, &rdt_all_groups);
Signature · 1 line
2.5.0
tip-bot for Wang Hui
merge botx86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system
Commit-ID: 36e74d355297dde6e69a39c838d24710e442babe Gitweb: https://git.kernel.org/tip/36e74d355297dde6e69a39c838d24710e442babe Author: Wang Hui <[email protected]> AuthorDate: Thu, 22 Feb 2018 19:26:03 -0800 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 23 Feb 2018 08:03:21 +0100
x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system
If no monitoring feature is detected because all monitoring features are disabled during boot time or there is no monitoring feature in hardware, creating rdtgroup sub-directory by "mkdir" command reports error:
mkdir: cannot create directory ‘/sys/fs/resctrl/p1’: No such file or directory
But the sub-directory actually is generated and content is correct:
cpus cpus_list schemata tasks
The error is because rdtgroup_mkdir_ctrl_mon() returns non zero value after the sub-directory is created and the returned value is reported as an error to user.
Clear the returned value to report to user that the sub-directory is actually created successfully.
--- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +1 -0
@@ -1804,6 +1804,7 @@ static int rdtgroup_mkdir_ctrl_mon(struct kernfs_node *parent_kn, goto out_common_fail; } closid = ret; + ret =0 ; rdtgrp->closid = closid;list_add (&rdtgrp->rdtgroup_list, &rdt_all_groups);