diff options
author | Ignat Korchagin <ignat@cloudflare.com> | 2019-09-16 10:30:23 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-09-16 10:30:23 -0600 |
commit | 667ac92a1a72b6038f0fae4acfc6a280fd69697b (patch) | |
tree | 2a5e5280e1ad47ee17fc958979ae2e2d74675de9 /blktrace.h | |
parent | a7263b8fb22f07f4f1a3ec54f0c37193c5908b22 (diff) | |
download | blktrace-667ac92a1a72b6038f0fae4acfc6a280fd69697b.tar.gz blktrace-667ac92a1a72b6038f0fae4acfc6a280fd69697b.tar.bz2 |
btreplay: fix device IO remap functionality
Commit dd093eb1c48e ("Fix warnings on newer gcc") moved string buffers holding
device names during map file parse stage to stack. However, only pointers to
them are being stored in the allocated "struct map_dev" structure. These
pointers are invalid outside of scope of this function and in a different
thread context. Also "release_map_devs" function still tries to "free" them
later as if they were allocated on the heap.
Moving the buffers back to the heap by instructing "fscanf" to allocate them
while parsing the file.
Alternatively, we could redefine the "struct map_dev" to include the whole
buffers instead of just pointers to them and free them as part of releasing the
whole "struct map_dev".
Fixes: dd093eb1c48e ("Fix warnings on newer gcc")
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'blktrace.h')
0 files changed, 0 insertions, 0 deletions