Hide Forgot
Description of problem: btrfs replace cannot handle RAID5 and RAID6, it only gives out EINVAL, user has to check dmesg for the reason of EINVAL # btrfs replace start -B /dev/loop2 /dev/loop3 /mnt/btrfs ERROR: ioctl(DEV_REPLACE_START) failed on "/mnt/btrfs": Invalid argument, no error # dmesg | tail -1 btrfs: dev_replace cannot yet handle RAID5/RAID6 btrfs should print the meaningful error reason to stderr. Not a big problem but kind of inconvenient. Version-Release number of selected component (if applicable): btrfs-progs-0.20.rc1.20130308git704a08c-1.el7 Current upstream btrfs-progs has this issue too, HEAD is 194aa4a btrfs-restore: deal with NULL returns from read_node_slot How reproducible: always Steps to Reproduce: 1. mkfs -t btrfs -m raid5 -d raid5 /dev/loop[0-2] 2. mount /dev/loop0 /mnt/btrfs 3. btrfs replace start -B /dev/loop2 /dev/loop3 Actual results: # btrfs replace start -B /dev/loop2 /dev/loop3 /mnt/btrfs ERROR: ioctl(DEV_REPLACE_START) failed on "/mnt/btrfs": Invalid argument, no error # dmesg | tail -1 btrfs: dev_replace cannot yet handle RAID5/RAID6 Expected results: btrfs prints error and the reason to stderr Additional info:
btrfs-progs 3.19.1 has been built for RHEL7.2; if possible, please retest this bug against that version to see if your problem has been resolved. Thanks, -Eric
Raid5/6 replaced is introduced since kernel-3.10.0-237, so only to this bug, it can be set to be virified. And I also test it with the btrfs-progs test case "/btrfs-progs/Regression/bz1012254-support-replace-raid56", works fine. The result is lile below: :: [ 11:29:55 ] :: [ WARNING ] :: POSIX mode detected and switched off :: [ 11:29:55 ] :: [ WARNING ] :: Please fix your test to have /bin/bash shebang :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: Setup :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ BEGIN ] :: Running 'setup_devs' :: [ PASS ] :: Command 'setup_devs' (Expected 0, got 0) :: [ BEGIN ] :: Running 'mkdir -p /mnt/btrfs' :: [ PASS ] :: Command 'mkdir -p /mnt/btrfs' (Expected 0, got 0) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: Test :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ BEGIN ] :: Running 'mkfs -t btrfs -f -m raid5 -d raid5 /dev/loop1 /dev/loop2 /dev/loop3' btrfs-progs v3.19.1 See http://btrfs.wiki.kernel.org for more information. Performing full device TRIM (1.00GiB) ... Turning ON incompat feature 'extref': increased hardlink limit per file to 65536 Turning ON incompat feature 'raid56': raid56 extended format Turning ON incompat feature 'skinny-metadata': reduced-size metadata extent refs Performing full device TRIM (1.00GiB) ... adding device /dev/loop2 id 2 Performing full device TRIM (1.00GiB) ... adding device /dev/loop3 id 3 fs created label (null) on /dev/loop1 nodesize 16384 leafsize 16384 sectorsize 4096 size 3.00GiB :: [ PASS ] :: Command 'mkfs -t btrfs -f -m raid5 -d raid5 /dev/loop1 /dev/loop2 /dev/loop3' (Expected 0, got 0) :: [ BEGIN ] :: Running 'mount /dev/loop1 /mnt/btrfs' :: [ PASS ] :: Command 'mount /dev/loop1 /mnt/btrfs' (Expected 0, got 0) :: [ BEGIN ] :: Running 'btrfs replace start -B -f /dev/loop1 /dev/loop0 /mnt/btrfs' :: [ PASS ] :: Command 'btrfs replace start -B -f /dev/loop1 /dev/loop0 /mnt/btrfs' (Expected 0, got 0) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: Cleanup :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ BEGIN ] :: Running 'cleanup' :: [ PASS ] :: Command 'cleanup' (Expected 0, got 0)
btrfs supports replace raid5/6 now and no error message is needed from btrfs-progs, I think we can just close this bug now.