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-next>] [day] [month] [year] [list]
Message-ID: <20170309145300.GA2849@gentoo>
Date:   Thu, 9 Mar 2017 15:53:00 +0100
From:   Marcin Ciupak <marcin.s.ciupak@...il.com>
To:     Oleg Drokin <oleg.drokin@...el.com>
Cc:     Andreas Dilger <andreas.dilger@...el.com>,
        James Simmons <jsimmons@...radead.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        lustre-devel@...ts.lustre.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] staging: lustre: replace simple_strtoul with kstrtoint

Replace simple_strtoul with kstrtoint.
simple_strtoul is marked for obsoletion.

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@...il.com>
---
 drivers/staging/lustre/lustre/obdclass/obd_mount.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
index 8e0d4b1d86dc..4a604e9b3e49 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
@@ -924,12 +924,24 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
 			lmd->lmd_flags |= LMD_FLG_ABORT_RECOV;
 			clear++;
 		} else if (strncmp(s1, "recovery_time_soft=", 19) == 0) {
-			lmd->lmd_recovery_time_soft = max_t(int,
-				simple_strtoul(s1 + 19, NULL, 10), time_min);
+			int res;
+
+			rc = kstrtoint(s1 + 19, 10, &res);
+			if (rc)
+				lmd->lmd_recovery_time_soft = time_min;
+			else
+				lmd->lmd_recovery_time_soft = max_t(int, res,
+								    time_min);
 			clear++;
 		} else if (strncmp(s1, "recovery_time_hard=", 19) == 0) {
-			lmd->lmd_recovery_time_hard = max_t(int,
-				simple_strtoul(s1 + 19, NULL, 10), time_min);
+			int res;
+
+			rc = kstrtoint(s1 + 19, 10, &res);
+			if (rc)
+				lmd->lmd_recovery_time_hard = time_min;
+			else
+				lmd->lmd_recovery_time_hard = max_t(int, res,
+								    time_min);
 			clear++;
 		} else if (strncmp(s1, "noir", 4) == 0) {
 			lmd->lmd_flags |= LMD_FLG_NOIR; /* test purpose only. */
-- 
2.11.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ