[PATCH 6/8] blktrace.c: Don't sleep indefinitely if there is a wrong timestamp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <lukasstraub2@xxxxxx>
---
 blktrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.34.1

Attachment: pgpk9ejxMqOrF.pgp
Description: OpenPGP digital signature


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux