blk-iolatency: only account submitted bios
authorDennis Zhou <dennis@kernel.org>
Thu, 23 May 2019 20:10:18 +0000 (16:10 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:14:09 +0000 (09:14 +0200)
commit3ae98dc2db1e937bda7cefdb9caadc653d865f58
treefbbc5f42d37f0e7319d2bf29428e402e4ed73133
parenta952f7c384aa52f22b14dc26d5dace7c939fe0a7
blk-iolatency: only account submitted bios

[ Upstream commit a3fb01ba5af066521f3f3421839e501bb2c71805 ]

As is, iolatency recognizes done_bio and cleanup as ending paths. If a
request is marked REQ_NOWAIT and fails to get a request, the bio is
cleaned up via rq_qos_cleanup() and ended in bio_wouldblock_error().
This results in underflowing the inflight counter. Fix this by only
accounting bios that were actually submitted.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Cc: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-iolatency.c