From: Lukas Straub Date: Wed, 19 Jan 2022 21:14:33 +0000 (+0000) Subject: blktrace.c: Don't sleep indefinitely if there is a wrong timestamp X-Git-Tag: fio-3.30~88 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=f36bd1341690e0c63718c32465e173874bf56727;p=fio.git blktrace.c: Don't sleep indefinitely if there is a wrong timestamp Each of my traces have a single entry with a wrong timestamp that causes a underflow followed by a infinite sleep. Fix this by checking for underflow. Signed-off-by: Lukas Straub Link: https://lore.kernel.org/r/a19b7ea899093c4c0ed98d2d9a310f2f0f01fddd.1642626314.git.lukasstraub2@web.de Signed-off-by: Jens Axboe --- diff --git a/blktrace.c b/blktrace.c index 7682a4d5..1faa83bf 100644 --- a/blktrace.c +++ b/blktrace.c @@ -307,7 +307,7 @@ static bool queue_trace(struct thread_data *td, struct blk_io_trace *t, return false; if (!(t->action & BLK_TC_ACT(BLK_TC_NOTIFY))) { - if (!last_ttime || td->o.no_stall) + if (!last_ttime || td->o.no_stall || t->time < last_ttime) delay = 0; else if (td->o.replay_time_scale == 100) delay = t->time - last_ttime;