On 2019/7/5 下午12:39, Vladimir Panteleev wrote: > Hi, > > I'm trying to convert a data=RAID10,metadata=RAID1 (4 disks) array to > RAID1 (2 disks). The array was less than half full, and I disconnected > two parity drives, leaving two that contained one copy of all data.
Definitely not something I would even try. I'd go convert, delete one, delete the other one, although it's slower, but should work properly. > > After stubbing out btrfs_check_rw_degradable (because btrfs currently > can't realize when it has all drives needed for RAID10), The point is, btrfs_check_rw_degradable() is already doing per-chunk level rw degradable checking. I would highly recommend not to comment out the function completely. It has been a long (well, not that long) way from old fs level tolerance to current per-chunk tolerance check. I totally understand for RAID10 we can at most drop half of its stripes as long as we have one device for each substripe. If you really want that feature to allow RAID10 to tolerate more missing devices, please do proper chunk stripe check. > I've > successfully mounted rw+degraded, balance-converted all RAID10 data to > RAID1, and then btrfs-device-delete-d one of the missing drives. It > fails at deleting the second. > > The process reached a point where the last missing device shows as > containing 20 GB of RAID1 metadata. At this point, attempting to delete > the device causes the operation to shortly fail with "No space left", > followed by a "kernel BUG at fs/btrfs/relocation.c:2499!", and the > "btrfs device delete" command to crash with a segmentation fault. > > Here is the information about the filesystem: > > https://dump.thecybershadow.net/55d558b4d0a59643e24c6b4ee9019dca/04%3A28%3A23-upload.txt The fs should have enough space to allocate new metadata chunk (it's metadata chunk lacking space and caused ENOSPC). I'm not sure if it's the degraded mount cause the problem, as the enospc_debug output looks like reserved/pinned/over-reserved space has taken up all space, while no new chunk get allocated. Would you please try to balance metadata to see if the ENOSPC still happens? Thanks, Qu > > > And here is the dmesg output (with enospc_debug): > > https://dump.thecybershadow.net/9d3811b85d078908141a30886df8894c/04%3A28%3A53-upload.txt > > > Attempting to unmount the filesystem causes another warning: > > https://dump.thecybershadow.net/6d6f2353cd07cd8464ece7e4df90816e/04%3A30%3A30-upload.txt > > > The umount command then hangs indefinitely. > > Linux 5.1.15-arch1-1-ARCH, btrfs-progs v5.1.1 >
signature.asc
Description: OpenPGP digital signature