Bug 72801

Summary: btrfs balance start -v -dusage=0 fails (btrfs-tools 3.12)
Product: File System Reporter: Marc MERLIN (marc)
Component: btrfsAssignee: Josef Bacik (josef)
Status: RESOLVED OBSOLETE    
Severity: high CC: dsterba, marc, szg00000
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.14 Subsystem:
Regression: No Bisected commit-id:

Description Marc MERLIN 2014-03-23 19:09:51 UTC
legolas:/mnt/btrfs_pool2# btrfs balance start -v -dusage=5 /mnt/btrfs_pool2
Dumping filters: flags 0x1, state 0x0, force is off
  DATA (flags 0x2): balancing, usage=5
ERROR: error during balancing '/mnt/btrfs_pool2' - No space left on device
There may be more info in syslog - try dmesg | tail
legolas:/mnt/btrfs_pool2# btrfs balance start -v -dusage=0 /mnt/btrfs_pool2
Dumping filters: flags 0x1, state 0x0, force is off
  DATA (flags 0x2): balancing, usage=0
ERROR: error during balancing '/mnt/btrfs_pool2' - No space left on device

legolas:/mnt/btrfs_pool2# btrfs fi df .
Data, single: total=800.42GiB, used=636.91GiB
System, DUP: total=8.00MiB, used=92.00KiB
System, single: total=4.00MiB, used=0.00
Metadata, DUP: total=10.00GiB, used=9.50GiB
Metadata, single: total=8.00MiB, used=0.00

Hugo requested a filesystem image
https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg32415.html

I cannot upload the image on bugzilla, it keeps timing out. I'll upload to my web server and provide a link when it's done.
Comment 1 Marc MERLIN 2014-03-23 21:19:45 UTC
Ok, the image is there: http://marc.merlins.org/tmp/pool2.image
Please let me know when you've retreived/analysed it and I'll remove it.
Comment 2 David Sterba 2014-03-24 11:03:38 UTC
I've seen something similar, usage=0 filter failed with ENOSPC when Metadata were almost full (but within margin of 512M). I think this should succeed because there's no 1G-chunk shifting and removing completely empty chunks changes only a few kb of metadata structures.

The 512M space diff is probably the global block reserve that cannot be normally used during balance, but possibly could in this special case.
Comment 3 David Sterba 2022-10-03 14:50:11 UTC
This is a semi-automated bugzilla cleanup, report is against an old kernel version. If the problem still happens, please open a new bug. Thanks.