Fix blktrace replay
We would add duplicate files, if the open event comes before
the add file event. Make sure we return the current index file
instead of adding a duplicate, this causes bad file lookups.
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
diff --git a/blktrace.c b/blktrace.c
index ef3e18f..68ba964 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -187,7 +187,7 @@
int fileno;
dprint(FD_BLKTRACE, "add devices %s\n", dev);
- fileno = add_file(td, dev);
+ fileno = add_file_exclusive(td, dev);
trace_add_open_event(td, fileno);
}
}