Version in base suite: 6.2-1+deb12u1 Base version: btrfs-progs_6.2-1+deb12u1 Target version: btrfs-progs_6.2-1+deb12u2 Base file: /srv/ftp-master.debian.org/ftp/pool/main/b/btrfs-progs/btrfs-progs_6.2-1+deb12u1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/b/btrfs-progs/btrfs-progs_6.2-1+deb12u2.dsc changelog | 16 + control | 2 patches/0002-btrfs-progs-dev-stats-fix-printing-wrong-values-in-t.patch | 83 ++++++++++ patches/series | 1 4 files changed, 101 insertions(+), 1 deletion(-) diff -Nru btrfs-progs-6.2/debian/changelog btrfs-progs-6.2/debian/changelog --- btrfs-progs-6.2/debian/changelog 2024-10-16 17:59:06.000000000 +0000 +++ btrfs-progs-6.2/debian/changelog 2025-10-31 19:16:11.000000000 +0000 @@ -1,3 +1,19 @@ +btrfs-progs (6.2-1+deb12u2) bookworm; urgency=medium + + * Acknowledge NMU. + * Cherry pick upstream commit:cba1ef1 "btrfs-progs: dev stats: fix printing + wrong values in tabular output" because this bug hides file and/or + metadata corruption that requires sysadmin action; That action is `btrfs + scrub`, which repairs the bad data (when there is a 2nd copy ie: raid1 + profile). If a 2nd copy is not available then the necessity of having to + restore corrupted files from backup (in profile=single) will no longer be + hidden. Thanks to Craig Hesling for reporting the bug and identifying the + commit of the fix (Closes: #1116278). + * Update the Maintainer field, because Adam Borowski is no longer + maintaining this package in Debian. + + -- Nicholas D Steeves Fri, 31 Oct 2025 15:16:11 -0400 + btrfs-progs (6.2-1+deb12u1) bookworm; urgency=medium * Non-maintainer upload. diff -Nru btrfs-progs-6.2/debian/control btrfs-progs-6.2/debian/control --- btrfs-progs-6.2/debian/control 2023-02-28 23:16:51.000000000 +0000 +++ btrfs-progs-6.2/debian/control 2025-10-31 19:16:11.000000000 +0000 @@ -1,7 +1,7 @@ Source: btrfs-progs Section: admin Priority: optional -Maintainer: Adam Borowski +Maintainer: Nicholas D Steeves Build-Depends: debhelper-compat (= 13), libext2fs-dev, pkg-config, diff -Nru btrfs-progs-6.2/debian/patches/0002-btrfs-progs-dev-stats-fix-printing-wrong-values-in-t.patch btrfs-progs-6.2/debian/patches/0002-btrfs-progs-dev-stats-fix-printing-wrong-values-in-t.patch --- btrfs-progs-6.2/debian/patches/0002-btrfs-progs-dev-stats-fix-printing-wrong-values-in-t.patch 1970-01-01 00:00:00.000000000 +0000 +++ btrfs-progs-6.2/debian/patches/0002-btrfs-progs-dev-stats-fix-printing-wrong-values-in-t.patch 2025-10-31 19:16:11.000000000 +0000 @@ -0,0 +1,83 @@ +From: David Sterba +Date: Tue, 7 Mar 2023 21:09:03 +0100 +Subject: btrfs-progs: dev stats: fix printing wrong values in tabular output + +The tabular output prints the same value for all columns: + + # btrfs device stats /srv/btrfs-data + [/dev/sdc1].write_io_errs 0 + [/dev/sdc1].read_io_errs 0 + [/dev/sdc1].flush_io_errs 0 + [/dev/sdc1].corruption_errs 0 + [/dev/sdc1].generation_errs 0 + [/dev/sdb1].write_io_errs 7489899 + [/dev/sdb1].read_io_errs 3751023 + [/dev/sdb1].flush_io_errs 117 + [/dev/sdb1].corruption_errs 68 + [/dev/sdb1].generation_errs 25 + + # btrfs device stats -T /srv/btrfs-data + Id Path Write errors Read errors Flush errors Corruption errors Generation errors + -- --------- ------------ ----------- ------------ ----------------- ----------------- + 1 /dev/sdc1 0 0 0 0 0 + 2 /dev/sdb1 25 25 25 25 25 + +The table_printf has a fixed list of columns and should not iterate over +them. Only check if some of the value is set and return error. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=217045 +Issue: #585 +Signed-off-by: David Sterba +--- + cmds/device.c | 30 +++++++----------------------- + 1 file changed, 7 insertions(+), 23 deletions(-) + +diff --git a/cmds/device.c b/cmds/device.c +index 2404842..ec70bb3 100644 +--- a/cmds/device.c ++++ b/cmds/device.c +@@ -648,16 +648,6 @@ static int print_device_stat_tabular(struct string_table *table, int row, + char *canonical_path = path_canonicalize(path); + int j; + int err = 0; +- static const struct { +- const char name[32]; +- enum btrfs_dev_stat_values stat_idx; +- } dev_stats[] = { +- { "write_io_errs", BTRFS_DEV_STAT_WRITE_ERRS }, +- { "read_io_errs", BTRFS_DEV_STAT_READ_ERRS }, +- { "flush_io_errs", BTRFS_DEV_STAT_FLUSH_ERRS }, +- { "corruption_errs", BTRFS_DEV_STAT_CORRUPTION_ERRS }, +- { "generation_errs", BTRFS_DEV_STAT_GENERATION_ERRS }, +- }; + + /* Skip header + --- line */ + row += 2; +@@ -677,20 +667,14 @@ static int print_device_stat_tabular(struct string_table *table, int row, + table_printf(table, 1, row, ">%s", canonical_path); + free(canonical_path); + +- for (j = 0; j < ARRAY_SIZE(dev_stats); j++) { +- enum btrfs_dev_stat_values stat_idx = dev_stats[j].stat_idx; ++ table_printf(table, 2, row, ">%llu", args->values[BTRFS_DEV_STAT_WRITE_ERRS]); ++ table_printf(table, 3, row, ">%llu", args->values[BTRFS_DEV_STAT_READ_ERRS]); ++ table_printf(table, 4, row, ">%llu", args->values[BTRFS_DEV_STAT_FLUSH_ERRS]); ++ table_printf(table, 5, row, ">%llu", args->values[BTRFS_DEV_STAT_CORRUPTION_ERRS]); ++ table_printf(table, 6, row, ">%llu", args->values[BTRFS_DEV_STAT_GENERATION_ERRS]); + +- /* We got fewer items than we know */ +- if (args->nr_items < stat_idx + 1) +- continue; +- +- table_printf(table, 2, row, ">%llu", args->values[stat_idx]); +- table_printf(table, 3, row, ">%llu", args->values[stat_idx]); +- table_printf(table, 4, row, ">%llu", args->values[stat_idx]); +- table_printf(table, 5, row, ">%llu", args->values[stat_idx]); +- table_printf(table, 6, row, ">%llu", args->values[stat_idx]); +- +- if (check && (args->values[stat_idx] > 0)) ++ for (j = 0; j < BTRFS_DEV_STAT_VALUES_MAX; j++) { ++ if (check && (args->values[j] > 0)) + err |= 64; + } + diff -Nru btrfs-progs-6.2/debian/patches/series btrfs-progs-6.2/debian/patches/series --- btrfs-progs-6.2/debian/patches/series 2024-10-16 17:59:06.000000000 +0000 +++ btrfs-progs-6.2/debian/patches/series 2025-10-31 19:16:11.000000000 +0000 @@ -1 +1,2 @@ convert-fix-bad-csum-for-migrated-range.diff +0002-btrfs-progs-dev-stats-fix-printing-wrong-values-in-t.patch