Commit 2ab14861 authored by Coly Li's avatar Coly Li Committed by Greg Kroah-Hartman

bcache: fix mistaken sysfs entry for io_error counter

commit 54619998 upstream.

In bch_cached_dev_files[] from driver/md/bcache/sysfs.c, sysfs_errors is
incorrectly inserted in. The correct entry should be sysfs_io_errors.

This patch fixes the problem and now I/O errors of cached device can be
read from /sys/block/bcache<N>/bcache/io_errors.

Fixes: c7b7bd07 ("bcache: add io_disable to struct cached_dev")
Signed-off-by: default avatarColy Li <colyli@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3c466df8
...@@ -175,7 +175,7 @@ SHOW(__bch_cached_dev) ...@@ -175,7 +175,7 @@ SHOW(__bch_cached_dev)
var_print(writeback_percent); var_print(writeback_percent);
sysfs_hprint(writeback_rate, sysfs_hprint(writeback_rate,
wb ? atomic_long_read(&dc->writeback_rate.rate) << 9 : 0); wb ? atomic_long_read(&dc->writeback_rate.rate) << 9 : 0);
sysfs_hprint(io_errors, atomic_read(&dc->io_errors)); sysfs_printf(io_errors, "%i", atomic_read(&dc->io_errors));
sysfs_printf(io_error_limit, "%i", dc->error_limit); sysfs_printf(io_error_limit, "%i", dc->error_limit);
sysfs_printf(io_disable, "%i", dc->io_disable); sysfs_printf(io_disable, "%i", dc->io_disable);
var_print(writeback_rate_update_seconds); var_print(writeback_rate_update_seconds);
...@@ -426,7 +426,7 @@ static struct attribute *bch_cached_dev_files[] = { ...@@ -426,7 +426,7 @@ static struct attribute *bch_cached_dev_files[] = {
&sysfs_writeback_rate_p_term_inverse, &sysfs_writeback_rate_p_term_inverse,
&sysfs_writeback_rate_minimum, &sysfs_writeback_rate_minimum,
&sysfs_writeback_rate_debug, &sysfs_writeback_rate_debug,
&sysfs_errors, &sysfs_io_errors,
&sysfs_io_error_limit, &sysfs_io_error_limit,
&sysfs_io_disable, &sysfs_io_disable,
&sysfs_dirty_data, &sysfs_dirty_data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment