Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753071AbdCFJMg (ORCPT ); Mon, 6 Mar 2017 04:12:36 -0500 Received: from mx2.suse.de ([195.135.220.15]:37187 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753017AbdCFJM3 (ORCPT ); Mon, 6 Mar 2017 04:12:29 -0500 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Eric Dumazet , Linus Torvalds , Jiri Slaby Subject: [PATCH 3.12 006/113] sysctl: fix proc_doulongvec_ms_jiffies_minmax() Date: Mon, 6 Mar 2017 10:10:30 +0100 Message-Id: <3e9c66ba2486ab928812d2ba200dd6e2ab1a1152.1488791430.git.jslaby@suse.cz> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1015 Lines: 36 From: Eric Dumazet 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit ff9f8a7cf935468a94d9927c68b00daae701667e upstream. We perform the conversion between kernel jiffies and ms only when exporting kernel value to user space. We need to do the opposite operation when value is written by user. Only matters when HZ != 1000 Signed-off-by: Eric Dumazet Signed-off-by: Linus Torvalds Signed-off-by: Jiri Slaby --- kernel/sysctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 37b95a2982af..2488148a66d7 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2229,6 +2229,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int break; if (neg) continue; + val = convmul * val / convdiv; if ((min && val < *min) || (max && val > *max)) continue; *i = val; -- 2.12.0