Whamcloud - gitweb
LU-4711 libcfs: Always clamp cdls_delay between min and max
authorRyan Haasken <haasken@cray.com>
Wed, 5 Mar 2014 15:23:07 +0000 (09:23 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 16 May 2014 19:54:49 +0000 (15:54 -0400)
commit7ea704c303c1f329449290c2b566205ef06f8815
treec6847e0c555d2b15f97a69e9344648e3dccd1824
parent046f50c36e2cc0f976612c056bd44479173be886
LU-4711 libcfs: Always clamp cdls_delay between min and max

In libcfs_debug_vmsg2, cdls_delay is only clamped between the minimum
and the maximum when it is increased by multiplying by the backoff
factor.  It is not clamped when it is decreased by dividing by the
backoff factor.  This allows it to achieve values less than the
minimum, which allows a console message to be printed that should have
been skipped.  This patch moves the clamping outside of the else
statement, ensuring that cdls_delay is always between the min and the
max after the first time through libcfs_debug_vmsg2.

Signed-off-by: Ryan Haasken <haasken@cray.com>
Change-Id: I5e587292b73b4c61ef306908fa10d324da5ce069
Reviewed-on: http://review.whamcloud.com/9503
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Chris Horn <hornc@cray.com>
Reviewed-by: Ann Koehler <amk@cray.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
libcfs/libcfs/tracefile.c