summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre
diff options
context:
space:
mode:
authorRyan Haasken2014-04-27 19:07:08 +0200
committerGreg Kroah-Hartman2014-04-27 19:31:01 +0200
commitb7d0254ce83019aebdc6bc3a7dcd4e720895ef1f (patch)
tree98b51768267acbed5946fbd0f55f59abba1e087f /drivers/staging/lustre
parentstaging/lustre/osc: Update inode timestamp for lockless IO as well (diff)
downloadkernel-qcow2-linux-b7d0254ce83019aebdc6bc3a7dcd4e720895ef1f.tar.gz
kernel-qcow2-linux-b7d0254ce83019aebdc6bc3a7dcd4e720895ef1f.tar.xz
kernel-qcow2-linux-b7d0254ce83019aebdc6bc3a7dcd4e720895ef1f.zip
staging/lustre: 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> Reviewed-on: http://review.whamcloud.com/9503 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4711 Reviewed-by: Chris Horn <hornc@cray.com> Reviewed-by: Ann Koehler <amk@cray.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r--drivers/staging/lustre/lustre/libcfs/tracefile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c
index 50d421816c4c..07845e844243 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c
@@ -416,13 +416,13 @@ console:
cdls->cdls_delay /= libcfs_console_backoff * 4;
} else {
cdls->cdls_delay *= libcfs_console_backoff;
-
- if (cdls->cdls_delay < libcfs_console_min_delay)
- cdls->cdls_delay = libcfs_console_min_delay;
- else if (cdls->cdls_delay > libcfs_console_max_delay)
- cdls->cdls_delay = libcfs_console_max_delay;
}
+ if (cdls->cdls_delay < libcfs_console_min_delay)
+ cdls->cdls_delay = libcfs_console_min_delay;
+ else if (cdls->cdls_delay > libcfs_console_max_delay)
+ cdls->cdls_delay = libcfs_console_max_delay;
+
/* ensure cdls_next is never zero after it's been seen */
cdls->cdls_next = (cfs_time_current() + cdls->cdls_delay) | 1;
}