From: Luis Useche Date: Wed, 15 Jun 2022 22:44:54 +0000 (-0700) Subject: Init file_cache to invalid (maj, min) X-Git-Tag: test-tag-2022-08-09~27^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=2fe71558c9718e88f6a1f243f2de0560e0c44aa0;p=fio.git Init file_cache to invalid (maj, min) In the very unlikely case that the trace was taken from a device with major and minor zeroes, the cache will wrongly hit the first time. We are hitting this problem when trying to replay generated traces with major and minor zeroes. Initializing with ~0U fixes this problem. Signed-off-by: Luis Useche --- diff --git a/blktrace.c b/blktrace.c index 619121c7..00e5f9a9 100644 --- a/blktrace.c +++ b/blktrace.c @@ -442,7 +442,10 @@ err: bool read_blktrace(struct thread_data* td) { struct blk_io_trace t; - struct file_cache cache = { }; + struct file_cache cache = { + .maj = ~0U, + .min = ~0U, + }; unsigned long ios[DDIR_RWDIR_SYNC_CNT] = { }; unsigned long long rw_bs[DDIR_RWDIR_CNT] = { }; unsigned long skipped_writes;