Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Mar 2017 22:41:37 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315693 - head/sys/kern
Message-ID:  <201703212241.v2LMfbYG059368@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Tue Mar 21 22:41:37 2017
New Revision: 315693
URL: https://svnweb.freebsd.org/changeset/base/315693

Log:
  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

Modified:
  head/sys/kern/kern_fail.c

Modified: head/sys/kern/kern_fail.c
==============================================================================
--- head/sys/kern/kern_fail.c	Tue Mar 21 22:21:29 2017	(r315692)
+++ head/sys/kern/kern_fail.c	Tue Mar 21 22:41:37 2017	(r315693)
@@ -425,7 +425,7 @@ fail_point_sleep(struct fail_point *fp, 
 	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)) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703212241.v2LMfbYG059368>