1 From foo@baz Sun May 27 16:52:54 CEST 2018
2 From: Wang Hui <john.wanghui@huawei.com>
3 Date: Thu, 22 Feb 2018 19:26:03 -0800
4 Subject: x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system
6 From: Wang Hui <john.wanghui@huawei.com>
8 [ Upstream commit 36e74d355297dde6e69a39c838d24710e442babe ]
10 If no monitoring feature is detected because all monitoring features are
11 disabled during boot time or there is no monitoring feature in hardware,
12 creating rdtgroup sub-directory by "mkdir" command reports error:
14 mkdir: cannot create directory ‘/sys/fs/resctrl/p1’: No such file or directory
16 But the sub-directory actually is generated and content is correct:
18 cpus cpus_list schemata tasks
20 The error is because rdtgroup_mkdir_ctrl_mon() returns non zero value after
21 the sub-directory is created and the returned value is reported as an error
24 Clear the returned value to report to user that the sub-directory is
25 actually created successfully.
27 Signed-off-by: Wang Hui <john.wanghui@huawei.com>
28 Signed-off-by: Zhang Yanfei <yanfei.zhang@huawei.com>
29 Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
30 Cc: Linus Torvalds <torvalds@linux-foundation.org>
31 Cc: Peter Zijlstra <peterz@infradead.org>
32 Cc: Ravi V Shankar <ravi.v.shankar@intel.com>
33 Cc: Thomas Gleixner <tglx@linutronix.de>
34 Cc: Tony Luck <tony.luck@intel.com>
35 Cc: Vikas <vikas.shivappa@intel.com>
36 Cc: Xiaochen Shen <xiaochen.shen@intel.com>
37 Link: http://lkml.kernel.org/r/1519356363-133085-1-git-send-email-fenghua.yu@intel.com
38 Signed-off-by: Ingo Molnar <mingo@kernel.org>
39 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
40 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
42 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 1 +
43 1 file changed, 1 insertion(+)
45 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
46 +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
47 @@ -1657,6 +1657,7 @@ static int rdtgroup_mkdir_ctrl_mon(struc
53 rdtgrp->closid = closid;
54 list_add(&rdtgrp->rdtgroup_list, &rdt_all_groups);