Skip to content

Commit 4da7c5c

Browse files
Shida Zhangaxboe
authored andcommitted
bcache: fix I/O accounting leak in detached_dev_do_request
When a bcache device is detached, discard requests are completed immediately. However, the I/O accounting started in cached_dev_make_request() is not ended, leading to 100% disk utilization reports in iostat. Add the missing bio_end_io_acct() call. Fixes: cafe563 ("bcache: A block layer cache") Signed-off-by: Shida Zhang <zhangshida@kylinos.cn> Acked-by: Coly Li <colyli@fnnas.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 6ea84d7 commit 4da7c5c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/md/bcache/request.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,7 @@ static void detached_dev_do_request(struct bcache_device *d,
11071107

11081108
if (bio_op(orig_bio) == REQ_OP_DISCARD &&
11091109
!bdev_max_discard_sectors(dc->bdev)) {
1110+
bio_end_io_acct(orig_bio, start_time);
11101111
bio_endio(orig_bio);
11111112
return;
11121113
}

0 commit comments

Comments
 (0)