On 2021-03-22 21:00, Holger Hoffstätte wrote:
So I just did a conversion from single to dup and got the following unexpected warning: $btrfs balance start -mconvert=dup /mnt/data WARNING: RAID5/6 support has known problems and is strongly discouraged to be used besides testing or evaluation. It is recommended that you use one of the other RAID profiles. The operation will continue in 10 seconds. Use Ctrl-C to stop. 10^C I let it run and it's dup now, so the conversion itself works correctly. Looks like this was introduced in [1] but offhand I don't see what's wrong. -h [1] https://github.com/kdave/btrfs-progs/commit/1ed5db8db445073eb0d8b807901b64edaac1d8c4
So..the expression if (!(ptrs[i]->flags & (BTRFS_BLOCK_GROUP_RAID6 | BTRFS_BLOCK_GROUP_RAID5))) doesn't work because ptrs[i]->flags is always 256, regardless of filesystem layout and to-balance args. Checking for ->flags & BTRFS_BLOCK_GROUP_RAID5 (1 << 7) is always 0 (even when setting up a 3-device fs and converting to/from raid5), checking for BTRFS_BLOCK_GROUP_RAID6 (1 << 8) is always true. There are more problems but this is what I found so far. I'm on kernel 5.10.x, was there maybe an ioctl-breaking ABI change in 5.11/5.12? Any other ideas? -h