btrfs-progs icon indicating copy to clipboard operation
btrfs-progs copied to clipboard

btrfs-convert aborted

Open jonashaag opened this issue 5 years ago • 14 comments

This is with btrfs-progs master

$ sudo ./btrfs-convert /dev/sdc1
create btrfs filesystem:
	blocksize: 4096
	nodesize:  16384
	features:  extref, skinny-metadata (default)
	checksum:  crc32c
free space report:
	total:     417914159104
	free:      101515264 (0.02%)
creating ext2 image file
Unable to find block group for 0
Unable to find block group for 0
Unable to find block group for 0
kernel-shared/ctree.c:2375: split_leaf: BUG_ON `1` triggered, value 1
./btrfs-convert(+0x29cac)[0x5578d3e9fcac]
./btrfs-convert(+0x2dce3)[0x5578d3ea3ce3]
./btrfs-convert(btrfs_search_slot+0x11d5)[0x5578d3ea57f4]
./btrfs-convert(btrfs_csum_file_block+0x42b)[0x5578d3ec2564]
./btrfs-convert(+0xdf52)[0x5578d3e83f52]
./btrfs-convert(main+0x1cd4)[0x5578d3e86120]
/usr/lib/libc.so.6(__libc_start_main+0xf2)[0x7f738f4d1152]
./btrfs-convert(_start+0x2e)[0x5578d3e83a8e]
Aborted

jonashaag avatar Nov 17 '20 16:11 jonashaag

free space report:
	total:     417914159104
	free:      101515264 (0.02%)

Isn't this already showing the problem?

You only have around 100MiB For metadata.

Considering how many data you have already, 400+G, just for csum you will need at least 400+MiB space.

No wonder btrfs_search_slot() fails with -ENOSPC

adam900710 avatar Nov 18 '20 00:11 adam900710

Fair enough, I just reported this because the traceback said BUG. If there isn’t anything to fix here maybe at least the error message could be improved.

jonashaag avatar Nov 18 '20 01:11 jonashaag

Also, according to df, I’ve had a lot more space left. Could it be that there was some space used by an earlier conversion attempt (that failed due to a bug in v5.4)?

jonashaag avatar Nov 18 '20 01:11 jonashaag

For the BUG_ON we definitely need to make it more graceful.

The space reported by ext* is not directly usable for btrfs. The space btrfs can utilize for its metadata is just a subset of the free space.

One of the main reason of greatly reduced usable space is fragmentation.

Btrfs needs somewhat contig free space for its new chunks, thus if your fs has a lot of free space, but very fragmented, then you can see the result.

Previously convert attempt won't cause anything different.

adam900710 avatar Nov 18 '20 02:11 adam900710

Downstream bug with btrfs-progs 5.10.

cmurf avatar Feb 19 '21 02:02 cmurf

Kernel bug report with v6.2

https://bugzilla.kernel.org/show_bug.cgi?id=203693

tomchiverton avatar Aug 23 '23 13:08 tomchiverton