path: root/blktrace.h
diff options
authorVasily Tarasov <>2012-02-27 08:21:11 +0100
committerJens Axboe <>2012-02-27 08:21:11 +0100
commitc3ce73f5a414900c5c4817cf2fa1eeb7837f17b8 (patch)
tree073ae4700efab6c78697bc86175e63a4005d2777 /blktrace.h
parentf6d38abde41a7b18808dcdab393f05d6300d16c3 (diff)
Too small arrays for file names
In our experiments blktrace/blkparse file names encode a lot of infomation about the particular experiment. We noticed that for long enough file names blkparse does not work. The reason is that per_cpu_info->fname[] is of 128 bytes. As a result, in setup_file() function only part of the file name gets to ->fname[]. Then stat() fails and we exit the function. Notice, that no error is printed in this case. In the following patch ->fname[] size is increased to POSIX defined PATH_MAX. Signed-off-by: Vasily Tarasov < Signed-off-by: Jens Axboe <>
Diffstat (limited to 'blktrace.h')
1 files changed, 2 insertions, 1 deletions
diff --git a/blktrace.h b/blktrace.h
index 8b3e031..5da6dbc 100644
--- a/blktrace.h
+++ b/blktrace.h
@@ -2,6 +2,7 @@
#define BLKTRACE_H
#include <stdio.h>
+#include <limits.h>
#include <byteswap.h>
#include <endian.h>
@@ -44,7 +45,7 @@ struct per_cpu_info {
int fd;
int fdblock;
- char fname[128];
+ char fname[PATH_MAX];
struct io_stats io_stats;