From 5abb3b74d384de85d91ed33bd9db487bc941e2de Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Tue, 21 Mar 2017 22:41:37 +0000 Subject: [PATCH] kern_fail: Allow sleeping for more than 2147483/hz seconds Because of integer types, the timeout calculation result was limited to INT_MAX / (1000 * hz) seconds. For systems with hz=10000, this is only 215 seconds. Perform the calculation with 64-bit math to allow sleeping for the full INT_MAX / hz interval (215000 seconds on such hz=10000 systems). Submitted by: Scott Ferris Sponsored by: Dell EMC Isilon --- sys/kern/kern_fail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_fail.c b/sys/kern/kern_fail.c index b5bf0664e6e..6f3115b3e15 100644 --- a/sys/kern/kern_fail.c +++ b/sys/kern/kern_fail.c @@ -425,7 +425,7 @@ fail_point_sleep(struct fail_point *fp, int msecs, int timo; /* Convert from millisecs to ticks, rounding up */ - timo = howmany(msecs * hz, 1000); + timo = howmany((int64_t)msecs * hz, 1000L); if (timo > 0) { if (!(fp->fp_flags & FAIL_POINT_USE_TIMEOUT_PATH)) {