Open
Description
It seems as though the tabular mode (-T
) of the device stats
sub-command seems to be broken. The tabular view shows zero errors, but the normal mode shows many read/write errors for one drive. Luckily, the "check" (-c
) mode still seems to work correctly.
Checkout this example:
someuser@nas:~$ sudo btrfs device stats /var/hdd
[/dev/mapper/sdc_crypt].write_io_errs 0
[/dev/mapper/sdc_crypt].read_io_errs 0
[/dev/mapper/sdc_crypt].flush_io_errs 0
[/dev/mapper/sdc_crypt].corruption_errs 0
[/dev/mapper/sdc_crypt].generation_errs 0
[/dev/mapper/sdd_crypt].write_io_errs 0
[/dev/mapper/sdd_crypt].read_io_errs 0
[/dev/mapper/sdd_crypt].flush_io_errs 0
[/dev/mapper/sdd_crypt].corruption_errs 0
[/dev/mapper/sdd_crypt].generation_errs 0
[/dev/mapper/sdb_crypt].write_io_errs 0
[/dev/mapper/sdb_crypt].read_io_errs 0
[/dev/mapper/sdb_crypt].flush_io_errs 0
[/dev/mapper/sdb_crypt].corruption_errs 0
[/dev/mapper/sdb_crypt].generation_errs 0
[/dev/mapper/sda_crypt].write_io_errs 17876972
[/dev/mapper/sda_crypt].read_io_errs 8890703
[/dev/mapper/sda_crypt].flush_io_errs 15
[/dev/mapper/sda_crypt].corruption_errs 3
[/dev/mapper/sda_crypt].generation_errs 0
someuser@nas:~$ sudo btrfs device stats -T /var/hdd
Id Path Write errors Read errors Flush errors Corruption errors Generation errors
-- --------------------- ------------ ----------- ------------ ----------------- -----------------
1 /dev/mapper/sdc_crypt 0 0 0 0 0
2 /dev/mapper/sdd_crypt 0 0 0 0 0
3 /dev/mapper/sdb_crypt 0 0 0 0 0
4 /dev/mapper/sda_crypt 0 0 0 0 0
someuser@nas:~$ sudo btrfs device stats /var/hdd
[/dev/mapper/sdc_crypt].write_io_errs 0
[/dev/mapper/sdc_crypt].read_io_errs 0
[/dev/mapper/sdc_crypt].flush_io_errs 0
[/dev/mapper/sdc_crypt].corruption_errs 0
[/dev/mapper/sdc_crypt].generation_errs 0
[/dev/mapper/sdd_crypt].write_io_errs 0
[/dev/mapper/sdd_crypt].read_io_errs 0
[/dev/mapper/sdd_crypt].flush_io_errs 0
[/dev/mapper/sdd_crypt].corruption_errs 0
[/dev/mapper/sdd_crypt].generation_errs 0
[/dev/mapper/sdb_crypt].write_io_errs 0
[/dev/mapper/sdb_crypt].read_io_errs 0
[/dev/mapper/sdb_crypt].flush_io_errs 0
[/dev/mapper/sdb_crypt].corruption_errs 0
[/dev/mapper/sdb_crypt].generation_errs 0
[/dev/mapper/sda_crypt].write_io_errs 17876972
[/dev/mapper/sda_crypt].read_io_errs 8890703
[/dev/mapper/sda_crypt].flush_io_errs 15
[/dev/mapper/sda_crypt].corruption_errs 3
[/dev/mapper/sda_crypt].generation_errs 0
Reproduction:
- Remove one hard drive from a mirrored BTRFS filesystem
- Run a scrub to generate some IO errors for the removed disk
- Run
sudo btrfs device stats /mount-point
to see correct errors count - Run
sudo btrfs device stats -T /mount-point
to see incorrect errors count