I then enabled -proposed and installed 4.15.0-152-generic, and rebooted:
$ sudo mount /dev/vdb /mnt
$ sudo btrfs filesystem balance start --full-balance /mnt
ERROR: error during balancing '/mnt': No space left on device
$ dmesg | tail -n 7
[ 34.131066] BTRFS info (device vdb): disk space caching is enabled
[ 34.131070] BTRFS info (device vdb): has skinny extents
[ 34.149906] BTRFS info (device vdb): checking UUID tree
[ 34.149946] BTRFS info (device vdb): continuing balance
[ 34.227645] BTRFS info (device vdb): 2 enospc errors during balance
[ 40.009032] BTRFS info (device vdb): relocating block group 27995340800 flags data
[ 40.200573] BTRFS info (device vdb): 14 enospc errors during balance
We no longer suffer a kernel oops, and instead, we correctly report that the disk is too full and a balance cannot be completed.
After deleting some files and re-issuing balances, balancing completes successfully.
$ sudo btrfs filesystem df /mnt
Data, single: total=4.88GiB, used=4.51GiB
System, DUP: total=32.00MiB, used=16.00KiB
Metadata, DUP: total=256.00MiB, used=5.39MiB
GlobalReserve, single: total=16.00MiB, used=0.00B
$ sudo btrfs filesystem balance start --full-balance /mnt
Done, had to relocate 8 out of 8 chunks
The kernel in -proposed fixes the problem, happy to mark Bionic as verified.
Performing verification for Bionic.
I installed 4.15.0-151-generic from -updates, and added the reproducer btrfs qcow2 image file to my VM.
From there, I mounted the filesystem and attempted to balance:
$ sudo mount /dev/vdb /mnt
$ sudo btrfs filesystem balance start --full-balance /mnt
Segmentation fault (core dumped)
Checking dmesg, we get the same oops as I reported:
https:/ /paste. ubuntu. com/p/wWHCgzZxT Z/
I then enabled -proposed and installed 4.15.0-152-generic, and rebooted:
$ sudo mount /dev/vdb /mnt
$ sudo btrfs filesystem balance start --full-balance /mnt
ERROR: error during balancing '/mnt': No space left on device
$ dmesg | tail -n 7
[ 34.131066] BTRFS info (device vdb): disk space caching is enabled
[ 34.131070] BTRFS info (device vdb): has skinny extents
[ 34.149906] BTRFS info (device vdb): checking UUID tree
[ 34.149946] BTRFS info (device vdb): continuing balance
[ 34.227645] BTRFS info (device vdb): 2 enospc errors during balance
[ 40.009032] BTRFS info (device vdb): relocating block group 27995340800 flags data
[ 40.200573] BTRFS info (device vdb): 14 enospc errors during balance
We no longer suffer a kernel oops, and instead, we correctly report that the disk is too full and a balance cannot be completed.
After deleting some files and re-issuing balances, balancing completes successfully.
$ sudo btrfs filesystem df /mnt
Data, single: total=4.88GiB, used=4.51GiB
System, DUP: total=32.00MiB, used=16.00KiB
Metadata, DUP: total=256.00MiB, used=5.39MiB
GlobalReserve, single: total=16.00MiB, used=0.00B
$ sudo btrfs filesystem balance start --full-balance /mnt
Done, had to relocate 8 out of 8 chunks
The kernel in -proposed fixes the problem, happy to mark Bionic as verified.