Re: [BUG] two raid consistency bugs

Qu Wenruo <[email protected]>
Newsgroups org.kernel.vger.linux-btrfs
Message-ID <[email protected]>

在 2026/7/15 01:40, Zhang Boyang 写道:
> Hello btrfs devs,
> 
> I found two raid-related bugs in btrfs. Two test cases are provided.
> 
> 
> BUG 1. fstests: btrfs/348: test ambiguous generation handling on raid1 profile
> 
> This test simulates a ambiguous generation which can be caused by, for
> example, two successive power failures. Please note this is not related
> to degraded mounts or nodatacow.
> 
> This bug may affect several raid levels, take raid1 (say disk A and B)
> as an example:
> 
> At first power failure during transaction N, metadata trees of
> generation N are written to disk A, but super is not committed. Nothing
> is written to disk B.
> 
> At second power failure during a different transaction N,

If it's a different transaction, why it will still have the same transid N?

> nothing is
> written to disk A, but metadata trees and super is committed to disk B.
> 
> This creates a ambiguous generation N in two disks. Currently btrfs
> can't detect this, and can lead to severe damages.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.