]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: count backing device I/O error for writeback I/O
authorColy Li <colyli@suse.de>
Thu, 3 May 2018 10:51:34 +0000 (18:51 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 3 May 2018 14:35:12 +0000 (08:35 -0600)
commit40a221024dd4c7535bf6d3b7036e8e25436c4864
treea3a4a141df58810c02dadc33dbe848f65d451310
parentdd2b614c8967c25c1fef93a9a5e56d2326942b87
bcache: count backing device I/O error for writeback I/O

Commit 4afaad3c4f293 ("bcache: add io_disable to struct cached_dev")
counts backing device I/O requets and set dc->io_disable to true if error
counters exceeds dc->io_error_limit. But it only counts I/O errors for
regular I/O request, neglects errors of write back I/Os when backing device
is offline.

This patch counts the errors of writeback I/Os, in dirty_endio() if
bio->bi_status is  not 0, it means error happens when writing dirty keys
to backing device, then bch_count_backing_io_errors() is called.

By this fix, even there is no reqular I/O request coming, if writeback I/O
errors exceed dc->io_error_limit, the bcache device may still be stopped
for the broken backing device.

Fixes: 4afaad3c4f293 ("bcache: add io_disable to struct cached_dev")
Signed-off-by: Coly Li <colyli@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/writeback.c