diff options
author | Omar Sandoval <osandov@fb.com> | 2017-03-16 09:46:14 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-03-21 10:00:55 -0600 |
commit | 7d8d00140715a115193bf502fa3b0cfe620f0dd9 (patch) | |
tree | d4a2c36663631ca44d278a346f7f9e994c1be5fb /block/blk-stat.c | |
parent | 97da3854c526d3a6ee05c849c96e48d21527606c (diff) | |
download | lwn-7d8d00140715a115193bf502fa3b0cfe620f0dd9.tar.gz lwn-7d8d00140715a115193bf502fa3b0cfe620f0dd9.zip |
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>
Diffstat (limited to 'block/blk-stat.c')
-rw-r--r-- | block/blk-stat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-stat.c b/block/blk-stat.c index 9b43efb8933f..186fcb981e9b 100644 --- a/block/blk-stat.c +++ b/block/blk-stat.c @@ -30,11 +30,11 @@ static void blk_stat_flush_batch(struct blk_rq_stat *stat) static void blk_stat_sum(struct blk_rq_stat *dst, struct blk_rq_stat *src) { + blk_stat_flush_batch(src); + if (!src->nr_samples) return; - blk_stat_flush_batch(src); - dst->min = min(dst->min, src->min); dst->max = max(dst->max, src->max); |