Re: [PATCH] btrfs: scrub: don't count zoned repairs as corrected on a degraded mount

From: Miroslav Cimerman

Date: Wed Nov 18 2026 - 20:23:12 EST


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). 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.

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