bcache: fix wrong cache_misses statistics
authortang.junhui <tang.junhui@zte.com.cn>
Mon, 30 Oct 2017 21:46:34 +0000 (14:46 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 30 Oct 2017 21:57:54 +0000 (15:57 -0600)
commitc157313791a999646901b3e3c6888514ebc36d62
tree8b5fef73f04ef261fcc6761950795ebd3db9cc5c
parentd44c2f9e7cc0041f0cd88df1fe7a1fceb713ab14
bcache: fix wrong cache_misses statistics

Currently, Cache missed IOs are identified by s->cache_miss, but actually,
there are many situations that missed IOs are not assigned a value for
s->cache_miss in cached_dev_cache_miss(), for example, a bypassed IO
(s->iop.bypass = 1), or the cache_bio allocate failed. In these situations,
it will go to out_put or out_submit, and s->cache_miss is null, which leads
bch_mark_cache_accounting() to treat this IO as a hit IO.

[ML: applied by 3-way merge]

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Reviewed-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/request.c