Commit 4da7c5c3 authored by Shida Zhang's avatar Shida Zhang Committed by Jens Axboe
Browse files

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: cafe5635 ("bcache: A block layer cache")
Signed-off-by: default avatarShida Zhang <zhangshida@kylinos.cn>
Acked-by: default avatarColy Li <colyli@fnnas.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6ea84d7a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1107,6 +1107,7 @@ static void detached_dev_do_request(struct bcache_device *d,

	if (bio_op(orig_bio) == REQ_OP_DISCARD &&
	    !bdev_max_discard_sectors(dc->bdev)) {
		bio_end_io_acct(orig_bio, start_time);
		bio_endio(orig_bio);
		return;
	}