1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00

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 <sferris at isilon.com>
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Conrad Meyer 2017-03-21 22:41:37 +00:00
parent 83157972d6
commit 5abb3b74d3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315693

View File

@ -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)) {