mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 10:24:01 -04:00
bcache: add io error counting in write_bdev_super_endio()
When backing device super block is written by bch_write_bdev_super(), the bio complete callback write_bdev_super_endio() simply ignores I/O status. Indeed such write request also contribute to backing device health status if the request failed. This patch checkes bio->bi_status in write_bdev_super_endio(), if there is error, bch_count_backing_io_errors() will be called to count an I/O error to dc->io_errors. Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -197,7 +197,9 @@ static const char *read_super(struct cache_sb *sb, struct block_device *bdev,
|
||||
static void write_bdev_super_endio(struct bio *bio)
|
||||
{
|
||||
struct cached_dev *dc = bio->bi_private;
|
||||
/* XXX: error checking */
|
||||
|
||||
if (bio->bi_status)
|
||||
bch_count_backing_io_errors(dc, bio);
|
||||
|
||||
closure_put(&dc->sb_write);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user