blk-stat: fix blk_stat_sum() if all samples are batched
authorOmar Sandoval <osandov@fb.com>
Thu, 16 Mar 2017 15:46:14 +0000 (09:46 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 16 Mar 2017 15:46:14 +0000 (09:46 -0600)
commitefd4b81abbe1ac753717f2f10cd3dab8bed6c103
tree2bba3ec40209e5ef9db3c083c39a941290cdfcb6
parent69eea5a4ab9c705496e912b55a9d312325de19e6
blk-stat: fix blk_stat_sum() if all samples are batched

We need to flush the batch _before_ we check the number of samples,
otherwise we'll miss all of the batched samples.

Fixes: cf43e6b ("block: add scalable completion tracking of requests")
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-stat.c