summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache
diff options
context:
space:
mode:
authorColy Li2019-06-28 13:59:30 +0200
committerJens Axboe2019-06-28 15:39:14 +0200
commit08ec1e6282f271698f0053983fab89de6e1a8217 (patch)
treec1b406c4b3772adf5808d8a18b443cf7317f1c4b /drivers/md/bcache
parentbcache: ignore read-ahead request failure on backing device (diff)
downloadkernel-qcow2-linux-08ec1e6282f271698f0053983fab89de6e1a8217.tar.gz
kernel-qcow2-linux-08ec1e6282f271698f0053983fab89de6e1a8217.tar.xz
kernel-qcow2-linux-08ec1e6282f271698f0053983fab89de6e1a8217.zip
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>
Diffstat (limited to 'drivers/md/bcache')
-rw-r--r--drivers/md/bcache/super.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index dc6702c2c4b6..73466bda12a7 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -197,7 +197,9 @@ err:
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);
}