]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
19777be382c162de21306ee3f987b5ef5214e42f
[thirdparty/kernel/stable-queue.git] /
1 From foo@baz Tue May 1 16:18:19 PDT 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
5
6 From: Wang Hui <john.wanghui@huawei.com>
7
8 [ Upstream commit 36e74d355297dde6e69a39c838d24710e442babe ]
9
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:
13
14 mkdir: cannot create directory ‘/sys/fs/resctrl/p1’: No such file or directory
15
16 But the sub-directory actually is generated and content is correct:
17
18 cpus cpus_list schemata tasks
19
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
22 to user.
23
24 Clear the returned value to report to user that the sub-directory is
25 actually created successfully.
26
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>
41 ---
42 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 1 +
43 1 file changed, 1 insertion(+)
44
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
48 if (ret < 0)
49 goto out_common_fail;
50 closid = ret;
51 + ret = 0;
52
53 rdtgrp->closid = closid;
54 list_add(&rdtgrp->rdtgroup_list, &rdt_all_groups);