kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
527 stars 239 forks source link

btrfs converted zoned RAID1 without RAID_STRIPE_TREE #738

Closed hanyuwei70 closed 4 months ago

hanyuwei70 commented 5 months ago

Device: HC620(HSH721414ALN6M0) I used following command created a RAID1 volume on zoned device w/o RST. (kernel 6.7.0)

# mkfs.btrfs /dev/sda
# btrfs dev add /dev/sdb /mnt
# btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt

and successfully mounted. What's more is that I can read & write some data on it. Then when I begun to BT download, it oops: https://fars.ee/sdDZ Should we forbid convert to RAID1 on zoned device w/o RST in btrfs-progs & kernel ?

edit 1: related dmesg:

Jan 31 15:19:34 loong3a6 kernel: BTRFS info (device sdb): disk added /dev/sdc
Jan 31 15:20:12 loong3a6 kernel: BTRFS info (device sdb): balance: start -dconvert=raid1 -mconvert=raid1 -sconvert=raid1
Jan 31 15:20:12 loong3a6 kernel: BTRFS info (device sdb): relocating block group 1610612736 flags metadata|dup
Jan 31 15:20:12 loong3a6 kernel: BTRFS info (device sdb): found 3 extents, stage: move data extents
Jan 31 15:20:12 loong3a6 kernel: BTRFS info (device sdb): relocating block group 1342177280 flags system|dup
Jan 31 15:20:12 loong3a6 kernel: BTRFS info (device sdb): relocating block group 1073741824 flags data
Jan 31 15:20:12 loong3a6 kernel: BTRFS info (device sdb): found 1 extents, stage: move data extents
Jan 31 15:20:13 loong3a6 kernel: BTRFS info (device sdb): found 1 extents, stage: update data pointers
Jan 31 15:20:13 loong3a6 kernel: BTRFS info (device sdb): balance: ended with status: 0
hanyuwei70 commented 5 months ago

seems even w/ RST(kernel 6.7.2) and a fresh mkfs, it still oops: https://fars.ee/N4pJ

hanyuwei70 commented 5 months ago

seems even w/ RST(kernel 6.7.2) and a fresh mkfs, it still oops: https://fars.ee/N4pJ

Confirmed it's unrelated to this problem. It is due to subpage layer issue.

hanyuwei70 commented 5 months ago

according to @Rongronggg9 advice, I have tried these

./nullb setup
./nullb create -s 4096 -z 256
./nullb create -s 4096 -z 256
./nullb ls
mkfs.btrfs -s 16k /dev/nullb0
mount /dev/nullb0 /mnt/tmp
btrfs device add /dev/nullb1 /mnt/tmp
btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt/tmp

dmesg will have zoned: data raid1 needs raid-stripe-tree both in 4k & 16k sector size. seems this bug only occured on real device. Will do any test if someone wish.

kdave commented 4 months ago

Yeah zoned and the raid profiles need RST, but I think the conversion is not checked ahead of time, only in btrfs_load_block_group_* where it's too late. @naota?

hanyuwei70 commented 4 months ago

Have already reached to Qu wenruo, he said Johannes is working on it.

kdave commented 4 months ago

Thanks for the report. Fixes are done in kernel, closing.