OSDN Git Service

bcache: fix misleading error message in bch_count_io_errors()
authorColy Li <colyli@suse.de>
Mon, 8 Jan 2018 20:21:29 +0000 (12:21 -0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 8 Jan 2018 20:29:00 +0000 (13:29 -0700)
commit5138ac6748e381501894976f995fb7d1a63f80f4
tree93140799f86e8b7536083f1722734491baba7c01
parent2831231d4c3f999d2d062b23dfbc8b0faa4bc6e0
bcache: fix misleading error message in bch_count_io_errors()

Bcache only does recoverable I/O for read operations by calling
cached_dev_read_error(). For write opertions there is no I/O recovery for
failed requests.

But in bch_count_io_errors() no matter read or write I/Os, before errors
counter reaches io error limit, pr_err() always prints "IO error on %,
recoverying". For write requests this information is misleading, because
there is no I/O recovery at all.

This patch adds a parameter 'is_read' to bch_count_io_errors(), and only
prints "recovering" by pr_err() when the bio direction is READ.

Signed-off-by: Coly Li <colyli@suse.de>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Reviewed-by: Tang Junhui <tang.junhui@zte.com.cn>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/bcache.h
drivers/md/bcache/io.c
drivers/md/bcache/super.c
drivers/md/bcache/writeback.c