From ada6fcee71b5eb65ea11ec36a3dd4f7e13d104e3 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 9 Dec 2015 09:08:10 -0700 Subject: [PATCH] eta: fix comparison reversal for time based jobs If time_based=1 and runtime=x, then we know the job will take x time to run. Fix a bug introduced in a previous commit. Fixes: ("Fix ETA calculations") Signed-off-by: Jens Axboe --- eta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eta.c b/eta.c index 8785540a..4362ffe3 100644 --- a/eta.c +++ b/eta.c @@ -214,7 +214,7 @@ static unsigned long thread_eta(struct thread_data *td) if (td->o.time_based) { if (timeout) { perc_t = (double) elapsed / (double) timeout; - if (perc_t > perc) + if (perc_t < perc) perc = perc_t; } else { /* -- 2.25.1