Ming Lei 84da7acc3b block: avoid double io accounting for flush request
For flush request, rq->end_io() may be called two times, one is from
timeout handling(blk_mq_check_expired()), another is from normal
completion(__blk_mq_end_request()).

Move blk_account_io_flush() after flush_rq->ref drops to zero, so
io accounting can be done just once for flush request.

Fixes: b68663186577 ("block: add iostat counters for flush requests")
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: John Garry <john.garry@huawei.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20210511152236.763464-2-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-05-24 06:47:21 -06:00
..
2021-05-08 21:49:48 -06:00
2021-04-28 14:27:12 -07:00
2020-09-03 15:20:47 -06:00
2020-03-17 20:55:21 +01:00
2021-05-09 13:25:14 -07:00
2020-05-29 16:30:39 -06:00
2021-04-08 10:24:36 -06:00
2020-09-23 09:18:13 -06:00
2020-01-06 20:59:04 -07:00