• Coly Li's avatar
    bcache: count backing device I/O error for writeback I/O · bf78980f
    Coly Li authored
    Commit c7b7bd07 ("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: c7b7bd07 ("bcache: add io_disable to struct cached_dev")
    Signed-off-by: default avatarColy Li <colyli@suse.de>
    Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    bf78980f
writeback.c 19.4 KB