All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Miroslav Cimerman <mc@raidlab.org>, Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: linux-btrfs@vger.kernel.org, David Sterba <dsterba@suse.com>,
	Chris Mason <mason@kernel.org>,
	Naohiro Aota <naohiro.aota@wdc.com>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: scrub: don't count zoned repairs as corrected on a degraded mount
Date: Fri, 20 Nov 2026 09:03:45 +1030	[thread overview]
Message-ID: <237c8b88-4ce9-4cbc-932b-dd1fdff3f66b@suse.com> (raw)
In-Reply-To: <RSMUZ1EIRwrw4g1uzc9_4FR9RoxzCzSBf9_b06-ovgxC7CsQ5GfC-E6b2vyTIE5l_FTRt-s8hlvskCD_gaf4UQePuf2tR6x011MGUO9nJO8=@raidlab.org>



在 2026/11/20 08:19, Miroslav Cimerman 写道:
> Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>> If it's a workaround for the well known new-SINGLE chunks during
>> degraded writes, it may be a little over-killed.
> 
> True, balance and block group reclaim already relocate block groups on
> degraded mounts with no such check.
> 
>> I'm more concerned if it's some extra requirement for zoned RAID
>> profiles, e.g. to keep the writer pointers in sync etc.
> 
> None that the repair would break: a regular mount needs equal write
> pointers, but a missing device falls behind on every degraded write
> anyway, not only on a repair. The problem is when that device comes
> back stale: two days ago my tester found that a degraded mount could
> then allocate over committed extents, which aborted the transaction or
> crashed. The series "btrfs: zoned: RAID1 block groups with missing or
> stale stripes" fixes that:
> https://lore.kernel.org/linux-btrfs/20261119213835.103131-1-mc@raidlab.org/
> 
> In testing with the skip removed, the relocation with a device really
> missing works: RAID1 on three devices stays RAID1, RAID1C3 on three
> devices gets single block groups, a second scrub is clean, and the
> missing device mounts normally when it comes back.
> 
> One thing it needs: without the skip, a degraded mount that reads a bad
> copy starts the relocation during mount. In testing, it raced with the
> mount, which failed and hit the uncommitted transaction ASSERT on its
> error path. "btrfs: zoned: wait for the relocating repair kthread
> during unmount" prevents that: with it, no repair starts before
> BTRFS_FS_OPEN is set:
> https://lore.kernel.org/linux-btrfs/20261118004808.201460-1-mc@raidlab.org/
> 
>> 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.
> 
> With that repair kthread patch, the skip can be dropped completely,
> so no check is left to share, and scrub needs no change for degraded
> mounts. It still counts errors as corrected when a repair is not
> started, e.g. while another one runs, just as on a regular mount.
> 
> In testing, with the series and the repair kthread patch applied and
> the skip removed, a stale device came back. A few scrubs on the
> degraded mount relocated the block groups it was behind on, and then a
> regular mount worked again, without a balance. Only a block group where
> scrub finds no error still needs a balance, e.g. when the missed range
> holds only nodatasum data.
> 
> One downside: when fewer devices are left than the profile needs, the
> repair relocates the block group as single, without the missing
> device's copy. A RAID1C3 or RAID1C4 block group then keeps one copy
> until a balance. Without the repair, it would get its copies back when
> the device returns.
> 
> Are you OK with a v2 that drops the skip completely, on top of that
> repair kthread patch?

I'm fine dropping that check, but it would be better to be a dedicated 
patch for extra review from zoned experts.

Thanks,
Qu

> 
> Thanks,
> Miroslav


      reply	other threads:[~2026-11-19 22:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 17:56 [PATCH] btrfs: scrub: don't count zoned repairs as corrected on a degraded mount Miroslav Cimerman
2026-11-18 20:37 ` Qu Wenruo
2026-11-19  1:22   ` Miroslav Cimerman
2026-11-19  2:37     ` Qu Wenruo
2026-11-19 21:49       ` Miroslav Cimerman
2026-11-19 22:33         ` Qu Wenruo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=237c8b88-4ce9-4cbc-932b-dd1fdff3f66b@suse.com \
    --to=wqu@suse.com \
    --cc=dsterba@suse.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mason@kernel.org \
    --cc=mc@raidlab.org \
    --cc=naohiro.aota@wdc.com \
    --cc=quwenruo.btrfs@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.