[PATCH] blktrace: fix for potential data overwrite
Here is the situation before the realloc:
fd_max_size
|
v
XXXOOOOXXXXX
^
|
fd_off
The X's are data, the O's are empty. What we start with after the realloc:
fd_max_size
|
v
XXXOOOOXXXXXOOOOOOOOOOOO
^
|
fd_off
In the original code we have the movement of data from byte 0
(tip->fd_buf) to tip->fd_off - over-writing data. I think if we use
tip->fd_max_size, we get the desired result (note: tip->fd_max_size is
updated to 2 times the size AFTER the memmove).