lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <778412ba2feaa95bb0f1663bc139e3a8829d729d.1458635566.git.zhaolei@cn.fujitsu.com>
Date:	Tue, 22 Mar 2016 16:37:05 +0800
From:	Zhao Lei <zhaolei@...fujitsu.com>
To:	<linux-kernel@...r.kernel.org>, Tejun Heo <htejun@...il.com>,
	Peter Zijlstra <peterz@...radead.org>
CC:	Yang Dongsheng <yangds.fnst@...fujitsu.com>,
	Zhao Lei <zhaolei@...fujitsu.com>
Subject: [PATCH v4 1/4] cpuacct: rename parameter in cpuusage_write for readability

From: Yang Dongsheng <yangds.fnst@...fujitsu.com>

The name of 'reset' makes a little confusion in reading, we would
say, if we want to reset usage, return -EINVAL. That's not true.

Actually, we want to say, we only allow user to do a reset. This
patch rename reset to val and add a comment here, making the code
more readable.

From: Dongsheng Yang <yangds.fnst@...fujitsu.com>
Acked-by: Tejun Heo <tj@...nel.org>
Signed-off-by: Zhao Lei <zhaolei@...fujitsu.com>
---
 kernel/sched/cpuacct.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
index dd7cbb5..9c2bbf7 100644
--- a/kernel/sched/cpuacct.c
+++ b/kernel/sched/cpuacct.c
@@ -145,13 +145,16 @@ static u64 cpuusage_read(struct cgroup_subsys_state *css, struct cftype *cft)
 }
 
 static int cpuusage_write(struct cgroup_subsys_state *css, struct cftype *cft,
-			  u64 reset)
+			  u64 val)
 {
 	struct cpuacct *ca = css_ca(css);
 	int err = 0;
 	int i;
 
-	if (reset) {
+	/*
+	 * Only allow '0' here to do a reset.
+	 */
+	if (val) {
 		err = -EINVAL;
 		goto out;
 	}
-- 
1.8.5.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ