diff options
author | Vasily Tarasov <tarasov@vasily.name> | 2012-02-27 08:21:11 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-02-27 08:21:11 +0100 |
commit | c3ce73f5a414900c5c4817cf2fa1eeb7837f17b8 (patch) | |
tree | 073ae4700efab6c78697bc86175e63a4005d2777 /blktrace.h | |
parent | f6d38abde41a7b18808dcdab393f05d6300d16c3 (diff) | |
download | blktrace-c3ce73f5a414900c5c4817cf2fa1eeb7837f17b8.tar.gz blktrace-c3ce73f5a414900c5c4817cf2fa1eeb7837f17b8.tar.bz2 |
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 <tarasov@vasily.name
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'blktrace.h')
-rw-r--r-- | blktrace.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |