Re: [PATCH] btrfs: scrub: don't count zoned repairs as corrected on a degraded mount
From: Qu Wenruo
Date: Wed Nov 18 2026 - 21:37:38 EST
在 2026/11/19 11:52, Miroslav Cimerman 写道:
Qu Wenruo <wqu@xxxxxxxx> wrote:
在 2026/11/19 04:26, Miroslav Cimerman 写道:
On a degraded mount btrfs_repair_one_zone() relocates nothing ("Do not
attempt to repair in degraded state"),
I think this is a little weird, any special reason for this in the first
place?
It was probably meant to check for a missing device (so that a mirror's
redundancy won't be downgraded by the relocation).
If it's a workaround for the well known new-SINGLE chunks during degraded writes, it may be a little over-killed.
A lot of btrfs-progs commands will do give extra warning when such unexpected profiles are detected, so end users can later balance them out after recovering.
(It's not the best solution, but it is not zoned specific either)
I'm more concerned if it's some extra requirement for zoned RAID profiles, e.g. to keep the writer pointers in sync etc.
But because it checks
with the mount flag, a -o degraded mount with no missing devices does
not get bad copies repaired by scrub.
I propose a v2 series, where 1/2 replaces the current mount flag check
with a missing devices check, and 2/2 is this patch modified to use the
same missing devices check as 1/2, so they are in sync. 2/2 is still
needed because for example RAID1C3 can have all: a good copy, bad copy,
and a missing device.
And I'd prefer if you can get some helper to know if this block group can be repaired, so that no duplicated checks between repair and scrub.
Thanks,
Qu
Are you okay with the proposal, Qu?
Fixes: 54765392a1b9 ("btrfs: scrub: introduce helper to queue a stripe for scrub")
I do not think this is the correct fixes tag, that commit is just
calling btrfs_repair_one_zone(), and btrfs is already calling that before.
You are right, the Fixes tag should be:
Fixes: f7ef5287a63d ("btrfs: zoned: relocate block group to repair IO failure in zoned filesystems")
Thanks,
Miroslav