* [BUG] two raid consistency bugs
@ 2026-07-14 16:10 Zhang Boyang
2026-07-14 16:10 ` [PATCH 1/2] fstests: btrfs/348: test ambiguous generation handling on raid1 profile Zhang Boyang
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Zhang Boyang @ 2026-07-14 16:10 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba, Qu Wenruo, Filipe Manana
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, 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.
I'd like to discuss possible solutions:
1) Turn btrfs metadata trees into merkle trees
This is the most CoW flavor solution. With a strong checksum algorithm,
merkle tree can gurantee ambiguous is detected and fixed. However it is
difficult to implement because metadata checksumming is done at bio time
(not at tree manipulation time), also on-disk format is changed.
2) A write-intent bitmap
This is the traditional solution to raid consistency problem. This can
also helps resync nodatacow data. However it seems there is an anandoned
series of write-intent patches in btrfs mailing list.
3) Generation redzone
Introduce a generation redzone value to superblock, which is updated at
mount time, for example:
1st mount: generation=N redzone=N -> next generation id is N+1
2nd mount: generation=N redzone=N+1 -> next generation id is N+2
3rd mount: generation=N redzone=N+2 -> next generation id is N+3
However it seems there can be infinte TRANS_STATE_UNBLOCKED
transactions, so it's hard to decide how may delta should we add to
redzone value to get next generation id.
Also, this redzone value is not applicable to tree-log, so BUG 2 (see
below) can't be solved.
4) Dirty workaround
Pin metadata to a dedicated device (which can be LVM raid1) and ask user
to run single metadata profile. This is too dirty and should not used.
BUG 2. fstests: btrfs/349: test if latest tree-log is choosen at mount time on raid1 profile
This test simulate a scenario that tree-log only exists in secondary
device, and test if latest tree-log is choosen at mount time. Currently,
the tree-log in the device with lowest devid is choosen. So fsync'ed
data may loss if tree-log only exists in secondary device.
A proposed draft fix is available at:
https://lore.kernel.org/linux-btrfs/20260605102607.23786-1-zhangboyang.id@gmail.com/
However, this draft fix also suffers from the above ambiguous generation
problem.
Zhang Boyang
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 1/2] fstests: btrfs/348: test ambiguous generation handling on raid1 profile
2026-07-14 16:10 [BUG] two raid consistency bugs Zhang Boyang
@ 2026-07-14 16:10 ` Zhang Boyang
2026-07-14 16:10 ` [PATCH 2/2] fstests: btrfs/349: test if latest tree-log is choosen at mount time " Zhang Boyang
2026-07-14 21:40 ` [BUG] two raid consistency bugs Qu Wenruo
2 siblings, 0 replies; 14+ messages in thread
From: Zhang Boyang @ 2026-07-14 16:10 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba, Qu Wenruo, Filipe Manana, Zhang Boyang
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.
Unfortunately, there is currently no fix for this problem.
Signed-off-by: Zhang Boyang <zhangboyang.id@gmail.com>
---
tests/btrfs/348 | 79 +++++++++++++++++++++++++
tests/btrfs/348.out | 141 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 220 insertions(+)
create mode 100755 tests/btrfs/348
create mode 100644 tests/btrfs/348.out
diff --git a/tests/btrfs/348 b/tests/btrfs/348
new file mode 100755
index 00000000..3fcaf744
--- /dev/null
+++ b/tests/btrfs/348
@@ -0,0 +1,79 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2026 Zhang Boyang. All Rights Reserved.
+#
+# FS QA Test 348
+#
+# Test btrfs ambiguous generation handling on raid1 profile.
+# This can be caused by, for example, two successive power failures.
+#
+. ./common/preamble
+_begin_fstest auto quick read_repair raid
+
+. ./common/filter
+. ./common/fail_make_request
+. ./common/dmdust
+
+_require_fail_make_request
+_require_scratch_dev_pool 2
+_require_dm_target dust
+
+_scratch_dev_pool_get 2
+_check_minimal_fs_size $(( 1024 * 1024 * 1024 ))
+# a strong checksum like sha256 can't protect you
+_scratch_pool_mkfs "-m raid1 -d raid1 -b 1G -n 4K --csum sha256" >> $seqres.full 2>&1
+dev2=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}'`
+_allow_fail_make_request
+
+echo "Step 1: prepare filesystem"
+_scratch_mount -o notreelog
+# create a 2-level FS_TREE, this is not strictly necessary
+# however this helps improve test result reproducibility (see below)
+for ((i = 0; i < 1000; i++)); do
+ $XFS_IO_PROG -f -c "pwrite -S 0xff 0 2K" $SCRATCH_MNT/foobar$i >> $seqres.full 2>&1
+done
+# the test file should reside in a leaf which is not read at mount time
+# so we can control which mirror to use by using _btrfs_buffered_read_on_mirror
+testfile="$SCRATCH_MNT/foobar42"
+_scratch_unmount
+
+echo "Step 2: simulate failure #1"
+_init_dust
+_mount_dust -o notreelog
+# simulate dev1 disappears just before writing superblock
+for ((i = 0; i < 4096 / 512; i++)); do
+ $DMSETUP_PROG message $DUST_NAME 0 addbadblock $((0x10000 / 512 + $i)) 255
+done
+$DMSETUP_PROG message $DUST_NAME 0 enable
+# simulate dev2 disappears before writing anything
+_bdev_fail_make_request $dev2 1
+# this write should fail
+$XFS_IO_PROG -f -c "pwrite -W -S 0xaa 0 2K" "$testfile" | _filter_xfs_io
+_cleanup_dust
+_bdev_fail_make_request $dev2 0
+
+echo "Step 3: simulate failure #2"
+_scratch_mount -o notreelog
+# simulate dev1 disappears before writing anything
+_bdev_fail_make_request $SCRATCH_DEV 1
+# this write should success
+$XFS_IO_PROG -f -c "pwrite -W -S 0xbb 0 2K" "$testfile" | _filter_xfs_io
+# simulate dev2 disappears after writing superblock
+_bdev_fail_make_request $dev2 1
+_scratch_unmount
+_bdev_fail_make_request $SCRATCH_DEV 0
+_bdev_fail_make_request $dev2 0
+
+echo "Step 4: simulate recovery"
+_scratch_mount -o notreelog
+# this read should trigger resync
+_btrfs_buffered_read_on_mirror 0 2 "$testfile" 0 2K
+echo "Step 5: verify written data"
+# read data should be 0xbb
+$XFS_IO_PROG -c "pread -v 0 2K" "$testfile" | _filter_xfs_io_offset
+_scratch_unmount
+
+_disallow_fail_make_request
+_scratch_dev_pool_put
+# success, all done
+_exit 0
diff --git a/tests/btrfs/348.out b/tests/btrfs/348.out
new file mode 100644
index 00000000..645c8b36
--- /dev/null
+++ b/tests/btrfs/348.out
@@ -0,0 +1,141 @@
+QA output created by 348
+Allow global fail_make_request feature
+Step 1: prepare filesystem
+Step 2: simulate failure #1
+fsync: Input/output error
+Step 3: simulate failure #2
+wrote 2048/2048 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Step 4: simulate recovery
+Step 5: verify written data
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+XXXXXXXX: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
+read 2048/2048 bytes
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Disallow global fail_make_request feature
--
2.53.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH 2/2] fstests: btrfs/349: test if latest tree-log is choosen at mount time on raid1 profile
2026-07-14 16:10 [BUG] two raid consistency bugs Zhang Boyang
2026-07-14 16:10 ` [PATCH 1/2] fstests: btrfs/348: test ambiguous generation handling on raid1 profile Zhang Boyang
@ 2026-07-14 16:10 ` Zhang Boyang
2026-07-14 21:40 ` [BUG] two raid consistency bugs Qu Wenruo
2 siblings, 0 replies; 14+ messages in thread
From: Zhang Boyang @ 2026-07-14 16:10 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba, Qu Wenruo, Filipe Manana, Zhang Boyang
This test simulate a scenario that tree-log only exists in secondary
device, and test if latest tree-log is choosen at mount time.
Currently, the tree-log in the device with lowest devid is choosen. So
fsync'ed data may loss if tree-log only exists in secondary device.
Signed-off-by: Zhang Boyang <zhangboyang.id@gmail.com>
---
tests/btrfs/349 | 53 +++++++++++++++++++++++++++++++++++++++++++++
tests/btrfs/349.out | 14 ++++++++++++
2 files changed, 67 insertions(+)
create mode 100755 tests/btrfs/349
create mode 100644 tests/btrfs/349.out
diff --git a/tests/btrfs/349 b/tests/btrfs/349
new file mode 100755
index 00000000..40e966c6
--- /dev/null
+++ b/tests/btrfs/349
@@ -0,0 +1,53 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2026 Zhang Boyang. All Rights Reserved.
+#
+# FS QA Test 349
+#
+# Test if latest tree-log is choosen at mount time on raid1 profile.
+#
+. ./common/preamble
+_begin_fstest auto quick read_repair raid
+
+. ./common/filter
+. ./common/fail_make_request
+
+_require_fail_make_request
+_require_scratch_dev_pool 2
+
+_scratch_dev_pool_get 2
+_check_minimal_fs_size $(( 1024 * 1024 * 1024 ))
+# a strong checksum like sha256 can't protect you
+_scratch_pool_mkfs "-m raid1 -d raid1 -b 1G --csum sha256" >> $seqres.full 2>&1
+dev2=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}'`
+_allow_fail_make_request
+
+echo "Step 1: prepare filesystem"
+_scratch_mount -o treelog
+$XFS_IO_PROG -f -c "pwrite -W -S 0xaa 0 8" $SCRATCH_MNT/foobar | _filter_xfs_io
+_scratch_unmount
+
+echo "Step 2: simulate failure"
+_scratch_mount -o treelog
+# simulate dev1 disappears before writing anything
+_bdev_fail_make_request $SCRATCH_DEV 1
+# this write should success
+$XFS_IO_PROG -f -c "pwrite -W -S 0xbb 0 8" $SCRATCH_MNT/foobar | _filter_xfs_io
+# simulate dev2 disappears after writing TREE_LOG
+_bdev_fail_make_request $dev2 1
+_scratch_unmount
+_bdev_fail_make_request $SCRATCH_DEV 0
+_bdev_fail_make_request $dev2 0
+
+echo "Step 3: simulate recovery"
+# this mount should start tree-log replay
+_scratch_mount -o treelog
+echo "Step 4: verify written data"
+# read data should be 0xbb
+$XFS_IO_PROG -c "pread -v 0 8" $SCRATCH_MNT/foobar | _filter_xfs_io_offset
+_scratch_unmount
+
+_disallow_fail_make_request
+_scratch_dev_pool_put
+# success, all done
+_exit 0
diff --git a/tests/btrfs/349.out b/tests/btrfs/349.out
new file mode 100644
index 00000000..1ebf4dc9
--- /dev/null
+++ b/tests/btrfs/349.out
@@ -0,0 +1,14 @@
+QA output created by 349
+Allow global fail_make_request feature
+Step 1: prepare filesystem
+wrote 8/8 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Step 2: simulate failure
+wrote 8/8 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Step 3: simulate recovery
+Step 4: verify written data
+XXXXXXXX: bb bb bb bb bb bb bb bb ........
+read 8/8 bytes
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Disallow global fail_make_request feature
--
2.53.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [BUG] two raid consistency bugs
2026-07-14 16:10 [BUG] two raid consistency bugs Zhang Boyang
2026-07-14 16:10 ` [PATCH 1/2] fstests: btrfs/348: test ambiguous generation handling on raid1 profile Zhang Boyang
2026-07-14 16:10 ` [PATCH 2/2] fstests: btrfs/349: test if latest tree-log is choosen at mount time " Zhang Boyang
@ 2026-07-14 21:40 ` Qu Wenruo
2026-07-15 5:46 ` Zhang Boyang
2 siblings, 1 reply; 14+ messages in thread
From: Qu Wenruo @ 2026-07-14 21:40 UTC (permalink / raw)
To: Zhang Boyang, linux-btrfs; +Cc: David Sterba, Qu Wenruo, Filipe Manana
在 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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [BUG] two raid consistency bugs
2026-07-14 21:40 ` [BUG] two raid consistency bugs Qu Wenruo
@ 2026-07-15 5:46 ` Zhang Boyang
2026-07-15 6:10 ` Qu Wenruo
0 siblings, 1 reply; 14+ messages in thread
From: Zhang Boyang @ 2026-07-15 5:46 UTC (permalink / raw)
To: Qu Wenruo, linux-btrfs; +Cc: David Sterba, Qu Wenruo, Filipe Manana
Hi,
On 2026/7/15 05:40, Qu Wenruo wrote:
>> 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?
>
Because the power failure occurred just before writing superblock
(transid N). The superblock on disk still has transid N-1.
After reboot, looking at superblock which transid is N-1, btrfs has no
idea of transid N existed previously, so it uses transid N for new
transcation.
>> 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.
By the way, I came up another solution:
If generation mismatch between devices (or log-tree mismatch) is
detected at mount time, set a dirty flag in superblock on device which
is behind.
If dirty flag is set for a device, disable read load balancing for that
device. So (meta)data only read from latest device(s).
If dirty flag is detected, ask user to run a scrub. The dirty flag is
cleared after a successful scrub.
Zhang Boyang
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [BUG] two raid consistency bugs
2026-07-15 5:46 ` Zhang Boyang
@ 2026-07-15 6:10 ` Qu Wenruo
2026-07-15 7:38 ` Zhang Boyang
0 siblings, 1 reply; 14+ messages in thread
From: Qu Wenruo @ 2026-07-15 6:10 UTC (permalink / raw)
To: Zhang Boyang, Qu Wenruo, linux-btrfs; +Cc: David Sterba, Filipe Manana
在 2026/7/15 15:16, Zhang Boyang 写道:
> Hi,
>
> On 2026/7/15 05:40, Qu Wenruo wrote:
>>> 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?
>>
>
> Because the power failure occurred just before writing superblock
> (transid N). The superblock on disk still has transid N-1.
>
> After reboot, looking at superblock which transid is N-1, btrfs has no
> idea of transid N existed previously, so it uses transid N for new
> transcation.
Then there should be no problem at least at the next mount after the
power loss.
>
>>> 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.
At the next mount, btrfs should detect device B has the latest super
block, and use that as the super block to mount.
Since metadata are all written to device B, even disk A may have some
stale tree blocks with transid N, stale tree blocks still need to meet
other conditions like root owner, level, first key checks.
I won't say that's impossible, and won't say we shouldn't do anything to
address it, but this is a variant of the split brain problems mentioned
in the past.
I strongly recommend to find out that thread and check if any of the
ideas are explored before and if they have their limits.
>
> By the way, I came up another solution:
>
> If generation mismatch between devices (or log-tree mismatch) is
> detected at mount time, set a dirty flag in superblock on device which
> is behind.
>
> If dirty flag is set for a device, disable read load balancing for that
> device. So (meta)data only read from latest device(s).
What if some metadata only arrives at that stale device, but not
completely reached the good device?
That kills the only chance to get the good metadata mirror.
And this won't solve the split brain situation either.
>
> If dirty flag is detected, ask user to run a scrub. The dirty flag is
> cleared after a successful scrub.
>
>
> Zhang Boyang
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [BUG] two raid consistency bugs
2026-07-15 6:10 ` Qu Wenruo
@ 2026-07-15 7:38 ` Zhang Boyang
2026-07-15 8:36 ` Qu Wenruo
0 siblings, 1 reply; 14+ messages in thread
From: Zhang Boyang @ 2026-07-15 7:38 UTC (permalink / raw)
To: Qu Wenruo, Qu Wenruo, linux-btrfs; +Cc: David Sterba, Filipe Manana
Hi,
On 2026/7/15 14:10, Qu Wenruo wrote:
>
>
> 在 2026/7/15 15:16, Zhang Boyang 写道:
>> Hi,
>>
>> On 2026/7/15 05:40, Qu Wenruo wrote:
>>>> 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?
>>>
>>
>> Because the power failure occurred just before writing superblock
>> (transid N). The superblock on disk still has transid N-1.
>>
>> After reboot, looking at superblock which transid is N-1, btrfs has no
>> idea of transid N existed previously, so it uses transid N for new
>> transcation.
>
> Then there should be no problem at least at the next mount after the
> power loss.
>
>>
>>>> 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.
>
> At the next mount, btrfs should detect device B has the latest super
> block, and use that as the super block to mount.
>
> Since metadata are all written to device B, even disk A may have some
> stale tree blocks with transid N, stale tree blocks still need to meet
> other conditions like root owner, level, first key checks.
>
> I won't say that's impossible, and won't say we shouldn't do anything to
> address it, but this is a variant of the split brain problems mentioned
> in the past.
>
I think this is a very special variant of split brain problem. This bug
can occur even if no degraded mounts are involved. All devices are
presented to btrfs at every mounts. Personally I don't like to call this
bug as a split brain problem because I think split brain should only
related to degraded mounts.
> I strongly recommend to find out that thread and check if any of the
> ideas are explored before and if they have their limits.
>
I did read some of these threads. If split brain problems are solved,
this bug can be solved as well. But I think fixing this particular bug
is also beneficial.
>>
>> By the way, I came up another solution:
>>
>> If generation mismatch between devices (or log-tree mismatch) is
>> detected at mount time, set a dirty flag in superblock on device which
>> is behind.
>>
>> If dirty flag is set for a device, disable read load balancing for
>> that device. So (meta)data only read from latest device(s).
>
> What if some metadata only arrives at that stale device, but not
> completely reached the good device?
>
Let me add another rule: always write superblocks of dirty devices after
superblocks of (one of) latest devices are fully written.
Therefore, as long as there is no died device, there is at least one
device not dirty so we can get golden data from it.
Of course performance may hit but we are safe.
> That kills the only chance to get the good metadata mirror.
>
A recovery option can be introduced to disable the above policy.
> And this won't solve the split brain situation either.
>
I'm not aiming to solve the split brain problems completely.
But waiting split brain problems to be solved is also a solution to this
particular bug though.
>>
>> If dirty flag is detected, ask user to run a scrub. The dirty flag is
>> cleared after a successful scrub.
>>
>>
>> Zhang Boyang
>
Zhang Boyang
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [BUG] two raid consistency bugs
2026-07-15 7:38 ` Zhang Boyang
@ 2026-07-15 8:36 ` Qu Wenruo
2026-07-15 9:25 ` Zhang Boyang
0 siblings, 1 reply; 14+ messages in thread
From: Qu Wenruo @ 2026-07-15 8:36 UTC (permalink / raw)
To: Zhang Boyang, Qu Wenruo, linux-btrfs; +Cc: David Sterba, Filipe Manana
在 2026/7/15 17:08, Zhang Boyang 写道:
> Hi,
>
> On 2026/7/15 14:10, Qu Wenruo wrote:
>>
>>
>> 在 2026/7/15 15:16, Zhang Boyang 写道:
>>> Hi,
>>>
>>> On 2026/7/15 05:40, Qu Wenruo wrote:
>>>>> 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?
>>>>
>>>
>>> Because the power failure occurred just before writing superblock
>>> (transid N). The superblock on disk still has transid N-1.
>>>
>>> After reboot, looking at superblock which transid is N-1, btrfs has
>>> no idea of transid N existed previously, so it uses transid N for new
>>> transcation.
>>
>> Then there should be no problem at least at the next mount after the
>> power loss.
>>
>>>
>>>>> 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.
>>
>> At the next mount, btrfs should detect device B has the latest super
>> block, and use that as the super block to mount.
>>
>> Since metadata are all written to device B, even disk A may have some
>> stale tree blocks with transid N, stale tree blocks still need to meet
>> other conditions like root owner, level, first key checks.
>>
>> I won't say that's impossible, and won't say we shouldn't do anything
>> to address it, but this is a variant of the split brain problems
>> mentioned in the past.
>>
>
> I think this is a very special variant of split brain problem. This bug
> can occur even if no degraded mounts are involved. All devices are
> presented to btrfs at every mounts. Personally I don't like to call this
> bug as a split brain problem because I think split brain should only
> related to degraded mounts.
>
>> I strongly recommend to find out that thread and check if any of the
>> ideas are explored before and if they have their limits.
>>
>
> I did read some of these threads. If split brain problems are solved,
> this bug can be solved as well. But I think fixing this particular bug
> is also beneficial.
I do not agree.
You're introducing more and more code just to handle some very specific
corner cases.
E.g. for your particular case, you will need a very specific write
situation. You're introducing a feature that is very hard to hit under
most situations, but we will always bear the burden.
I am not even sure if you'll still contribute in the next 5 years, thus
I won't bet my 5 cents on that this feature will be properly maintained.
To me, if you really bother this particular situation for whatever
reason, just introduce a special harden mount option, that any
barrier/super block write failure will mark the fs error.
That will be a much safer bet than any of your proposal.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [BUG] two raid consistency bugs
2026-07-15 8:36 ` Qu Wenruo
@ 2026-07-15 9:25 ` Zhang Boyang
2026-07-15 9:44 ` Qu Wenruo
0 siblings, 1 reply; 14+ messages in thread
From: Zhang Boyang @ 2026-07-15 9:25 UTC (permalink / raw)
To: Qu Wenruo, Qu Wenruo, linux-btrfs; +Cc: David Sterba, Filipe Manana
Hi,
On 2026/7/15 16:36, Qu Wenruo wrote:
> You're introducing more and more code just to handle some very specific
> corner cases.
>
> E.g. for your particular case, you will need a very specific write
> situation. You're introducing a feature that is very hard to hit under
> most situations, but we will always bear the burden.
>
Technically the runtime burden is small because generation mismatch is
rare. If no generation mismatch is detected, no device will be marked
dirty and no runtime burden is involved. On the other side, if
generation mismatch is detected, you always want to run a scrub to
resync your array.
> I am not even sure if you'll still contribute in the next 5 years, thus
> I won't bet my 5 cents on that this feature will be properly maintained.
>
For maintenance burden, yes, there is maintenance burden. So I'm here to
discuss which way to fix this bug is proper.
> To me, if you really bother this particular situation for whatever
> reason, just introduce a special harden mount option, that any barrier/
> super block write failure will mark the fs error.
>
> That will be a much safer bet than any of your proposal.
This can be a solution, at the cost of one failing drive will render
entire raid array unavailable.
Personally I like the idea of turning metadata trees into merkle trees
(so I wrote it first). But since you are the maintainer, I will let you
decide which way is appropriate.
Zhang Boyang
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [BUG] two raid consistency bugs
2026-07-15 9:25 ` Zhang Boyang
@ 2026-07-15 9:44 ` Qu Wenruo
2026-07-15 10:07 ` Zhang Boyang
0 siblings, 1 reply; 14+ messages in thread
From: Qu Wenruo @ 2026-07-15 9:44 UTC (permalink / raw)
To: Zhang Boyang, Qu Wenruo, linux-btrfs; +Cc: David Sterba, Filipe Manana
在 2026/7/15 18:55, Zhang Boyang 写道:
> Hi,
>
> On 2026/7/15 16:36, Qu Wenruo wrote:
>
>> You're introducing more and more code just to handle some very
>> specific corner cases.
>>
>> E.g. for your particular case, you will need a very specific write
>> situation. You're introducing a feature that is very hard to hit under
>> most situations, but we will always bear the burden.
>>
>
> Technically the runtime burden is small because generation mismatch is
> rare. If no generation mismatch is detected, no device will be marked
> dirty and no runtime burden is involved. On the other side, if
> generation mismatch is detected, you always want to run a scrub to
> resync your array.
>
>> I am not even sure if you'll still contribute in the next 5 years,
>> thus I won't bet my 5 cents on that this feature will be properly
>> maintained.
>>
> For maintenance burden, yes, there is maintenance burden. So I'm here to
> discuss which way to fix this bug is proper.
>
>> To me, if you really bother this particular situation for whatever
>> reason, just introduce a special harden mount option, that any
>> barrier/ super block write failure will mark the fs error.
>>
>> That will be a much safer bet than any of your proposal.
>
> This can be a solution, at the cost of one failing drive will render
> entire raid array unavailable.
>
> Personally I like the idea of turning metadata trees into merkle trees
> (so I wrote it first). But since you are the maintainer, I will let you
> decide which way is appropriate.
I'm not the maintainer, I just default to not trust ideas/features from
unproven contributors, especially when the idea/feature is not simple.
Especially considering the increased patches generated by LLMs.
So my suggestion is, if you really want to do long-term contributions,
stop coming up with fancy ideas, start from basics like doing proper
fstests runs with various combinations, report real bugs and fix simple
ones by yourself.
Earn your name first then consider fancy ideas.
>
>
> Zhang Boyang
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [BUG] two raid consistency bugs
2026-07-15 9:44 ` Qu Wenruo
@ 2026-07-15 10:07 ` Zhang Boyang
2026-07-15 10:11 ` Qu Wenruo
0 siblings, 1 reply; 14+ messages in thread
From: Zhang Boyang @ 2026-07-15 10:07 UTC (permalink / raw)
To: Qu Wenruo, Qu Wenruo, linux-btrfs; +Cc: David Sterba, Filipe Manana
Hi,
On 2026/7/15 17:44, Qu Wenruo wrote:
>> Personally I like the idea of turning metadata trees into merkle trees
>> (so I wrote it first). But since you are the maintainer, I will let
>> you decide which way is appropriate.
>
> I'm not the maintainer, I just default to not trust ideas/features from
> unproven contributors, especially when the idea/feature is not simple.
>
> Especially considering the increased patches generated by LLMs.
>
I understand your concern.
>
> So my suggestion is, if you really want to do long-term contributions,
> stop coming up with fancy ideas, start from basics like doing proper
> fstests runs with various combinations, report real bugs and fix simple
> ones by yourself.
>
> Earn your name first then consider fancy ideas.
>
That's exactly what I'm doing. I'm not requesting devs to fix this bug
immediately or implement my fancy idea. I wrote two test cases and hope
it will be helpful to btrfs development. It would be better if these two
test cases can be merged to test suite.
I even wrote a draft patch to fix the second bug. However, the first bug
is not easily solvable. So I had to discuss possible solutions. If
possible, I would have written a draft patch for the first bug, too.
Zhang Boyang
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [BUG] two raid consistency bugs
2026-07-15 10:07 ` Zhang Boyang
@ 2026-07-15 10:11 ` Qu Wenruo
2026-07-15 10:41 ` Zhang Boyang
2026-07-15 13:11 ` Alan Huang
0 siblings, 2 replies; 14+ messages in thread
From: Qu Wenruo @ 2026-07-15 10:11 UTC (permalink / raw)
To: Zhang Boyang, Qu Wenruo, linux-btrfs; +Cc: David Sterba, Filipe Manana
在 2026/7/15 19:37, Zhang Boyang 写道:
> Hi,
>
> On 2026/7/15 17:44, Qu Wenruo wrote:
>>> Personally I like the idea of turning metadata trees into merkle
>>> trees (so I wrote it first). But since you are the maintainer, I will
>>> let you decide which way is appropriate.
>>
>> I'm not the maintainer, I just default to not trust ideas/features
>> from unproven contributors, especially when the idea/feature is not
>> simple.
>>
>> Especially considering the increased patches generated by LLMs.
>>
>
> I understand your concern.
>
>>
>> So my suggestion is, if you really want to do long-term contributions,
>> stop coming up with fancy ideas, start from basics like doing proper
>> fstests runs with various combinations, report real bugs and fix
>> simple ones by yourself.
>>
>> Earn your name first then consider fancy ideas.
>>
>
> That's exactly what I'm doing. I'm not requesting devs to fix this bug
> immediately or implement my fancy idea. I wrote two test cases and hope
> it will be helpful to btrfs development. It would be better if these two
> test cases can be merged to test suite.
No, we will not push for test cases without a fix.
There is already a known failure, generic/747, and at least I'm not the
only one regretting pushing that.
>
> I even wrote a draft patch to fix the second bug. However, the first bug
> is not easily solvable. So I had to discuss possible solutions. If
> possible, I would have written a draft patch for the first bug, too.
This is already what I call fancy ideas.
Anyway, this will mostly just get yourself ignored if you really choose
to start from fancy projects.
Those long existing problems are still there for a reason.
If you believe you're smarter than everyone else, then go ahead, no one
is going to make you change your mind.
>
>
> Zhang Boyang
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [BUG] two raid consistency bugs
2026-07-15 10:11 ` Qu Wenruo
@ 2026-07-15 10:41 ` Zhang Boyang
2026-07-15 13:11 ` Alan Huang
1 sibling, 0 replies; 14+ messages in thread
From: Zhang Boyang @ 2026-07-15 10:41 UTC (permalink / raw)
To: Qu Wenruo, Qu Wenruo, linux-btrfs; +Cc: David Sterba, Filipe Manana
Hi,
On 2026/7/15 18:11, Qu Wenruo wrote:
>> That's exactly what I'm doing. I'm not requesting devs to fix this bug
>> immediately or implement my fancy idea. I wrote two test cases and
>> hope it will be helpful to btrfs development. It would be better if
>> these two test cases can be merged to test suite.
>
> No, we will not push for test cases without a fix.
>
> There is already a known failure, generic/747, and at least I'm not the
> only one regretting pushing that.
>
That's a strange policy. Is this a btrfs policy only or it applies to
whole xfstests?
>>
>> I even wrote a draft patch to fix the second bug. However, the first
>> bug is not easily solvable. So I had to discuss possible solutions. If
>> possible, I would have written a draft patch for the first bug, too.
>
> This is already what I call fancy ideas.
>
> Anyway, this will mostly just get yourself ignored if you really choose
> to start from fancy projects.
> Those long existing problems are still there for a reason.
>
Ok, the first bug is a bit fancy, but what about the second one? I don't
think the second bug is hard to solve (if you ignore the first bug).
> If you believe you're smarter than everyone else, then go ahead, no one
> is going to make you change your mind.
>
This is a strange accusation and I don't like your attitude. I never
thought I am smarter than everyone else.
Zhang Boyang
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [BUG] two raid consistency bugs
2026-07-15 10:11 ` Qu Wenruo
2026-07-15 10:41 ` Zhang Boyang
@ 2026-07-15 13:11 ` Alan Huang
1 sibling, 0 replies; 14+ messages in thread
From: Alan Huang @ 2026-07-15 13:11 UTC (permalink / raw)
To: Qu Wenruo
Cc: Zhang Boyang, Qu Wenruo, linux-btrfs, David Sterba, Filipe Manana
On Jul 15, 2026, at 18:11, Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>
>
>
> 在 2026/7/15 19:37, Zhang Boyang 写道:
>> Hi,
>> On 2026/7/15 17:44, Qu Wenruo wrote:
>>>> Personally I like the idea of turning metadata trees into merkle trees (so I wrote it first). But since you are the maintainer, I will let you decide which way is appropriate.
>>>
>>> I'm not the maintainer, I just default to not trust ideas/features from unproven contributors, especially when the idea/feature is not simple.
>>>
>>> Especially considering the increased patches generated by LLMs.
>>>
>> I understand your concern.
>>>
>>> So my suggestion is, if you really want to do long-term contributions, stop coming up with fancy ideas, start from basics like doing proper fstests runs with various combinations, report real bugs and fix simple ones by yourself.
>>>
>>> Earn your name first then consider fancy ideas.
>>>
>> That's exactly what I'm doing. I'm not requesting devs to fix this bug immediately or implement my fancy idea. I wrote two test cases and hope it will be helpful to btrfs development. It would be better if these two test cases can be merged to test suite.
>
> No, we will not push for test cases without a fix.
>
> There is already a known failure, generic/747, and at least I'm not the only one regretting pushing that.
Then why not delete it ?
>
>> I even wrote a draft patch to fix the second bug. However, the first bug is not easily solvable. So I had to discuss possible solutions. If possible, I would have written a draft patch for the first bug, too.
>
> This is already what I call fancy ideas.
>
> Anyway, this will mostly just get yourself ignored if you really choose to start from fancy projects.
> Those long existing problems are still there for a reason.
>
> If you believe you're smarter than everyone else, then go ahead, no one is going to make you change your mind.
>
>> Zhang Boyang
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-07-15 13:12 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 16:10 [BUG] two raid consistency bugs Zhang Boyang
2026-07-14 16:10 ` [PATCH 1/2] fstests: btrfs/348: test ambiguous generation handling on raid1 profile Zhang Boyang
2026-07-14 16:10 ` [PATCH 2/2] fstests: btrfs/349: test if latest tree-log is choosen at mount time " Zhang Boyang
2026-07-14 21:40 ` [BUG] two raid consistency bugs Qu Wenruo
2026-07-15 5:46 ` Zhang Boyang
2026-07-15 6:10 ` Qu Wenruo
2026-07-15 7:38 ` Zhang Boyang
2026-07-15 8:36 ` Qu Wenruo
2026-07-15 9:25 ` Zhang Boyang
2026-07-15 9:44 ` Qu Wenruo
2026-07-15 10:07 ` Zhang Boyang
2026-07-15 10:11 ` Qu Wenruo
2026-07-15 10:41 ` Zhang Boyang
2026-07-15 13:11 ` Alan Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox