stats: fix io_u_plat out-of-bound accesses (round 2)
authorEric Gouriou <egouriou@google.com>
Tue, 16 Aug 2011 06:35:43 +0000 (08:35 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Tue, 16 Aug 2011 06:35:43 +0000 (08:35 +0200)
commit0a7d7f9e450f823b4ca25c23516050c339778b13
tree88d520a65fab67515c4dde0dcc350d771dd28a62
parent271067a6e278dafd62649257fe99ce536acfe7bb
stats: fix io_u_plat out-of-bound accesses (round 2)

Commit 833491908a1afd67 introduced the ability to report completion
latency percentiles. It also caused a memory corruption when running
with multiple threads due to out of bound accesses in show_run_stats().
The major index of the io_u_plat two-dimensional array is meant
to be DDIR_ value in {DDIR_READ, DDIR_WRITE} (i.e., {0, 1}). The
code in show_run_stats() incorrectly wrote into the array using
a major index with values {0, 1, 2}. Commit 0a0b49007cbce8d1 fixed
the out of bound accesses by increasing the size of the major
dimension of the io_u_plat array from 2 to 3.

This patch reverts the size change from 0a0b49007cbce8d1 in favor
of avoiding the out-of-bound accesses in show_run_stats().

Signed-off-by: Eric Gouriou <egouriou@google.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
fio.h
stat.c