Bug 1219930 - btrfs-balance kernel 6.7 metadata over-allocation
Summary: btrfs-balance kernel 6.7 metadata over-allocation
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Kernel:Filesystems (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Filipe Manana
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-14 14:41 UTC by Martin Wilck
Modified: 2024-04-08 20:22 UTC (History)
5 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Wilck 2024-02-14 14:41:26 UTC
Upstream report:

https://lore.kernel.org/linux-btrfs/CAL3q7H5UaYcAYHijBO+QTnnpruVQXvdirg05_X94KRKrKnXDZw@mail.gmail.com/T/

Patches have been submitted for 6.8-rc5:

https://lore.kernel.org/linux-btrfs/cover.1707900530.git.dsterba@suse.com/T/#u

The patches aren't in the stable tree yet, and there are no backports in the openSUSE stable branch as of now, afaict.

The default setting for scheduled btrfs balance in the btrfsmaintenance package is "weekly", and 6.7 is in TW since beginning of February, so people will be hurt by this issue now.
Comment 1 Martin Wilck 2024-02-14 14:42:40 UTC
Assiging to Filipe, as he's been working on the issue upstream.
Comment 2 Michael Pujos 2024-02-14 16:01:12 UTC
The 

In the meantime, the wasted metadata space can be reclaimed with:

sudo btrfs balance start -musage=1 /

if this command results in 'No space left on device' like it did on my system (despite 'estimated free space' being multiple GBs), try first with -musage=30 then again with -musage=1
Comment 3 Jiri Slaby 2024-02-15 07:14:04 UTC
Could you push those to the stable branch, please?
Comment 4 Martin Wilck 2024-02-16 19:53:55 UTC
I am not sure which of Filipe's patches are required for fixing this issue. I'd be really grateful if Filipe could have a look himself.
Comment 5 Jiri Slaby 2024-02-17 07:49:00 UTC
In the meantime, I took David's:
https://lore.kernel.org/all/20240215133633.25420-1-dsterba@suse.com/
Comment 6 Jiri Slaby 2024-02-17 07:49:27 UTC
(In reply to Jiri Slaby from comment #5)
> In the meantime, I took David's:
> https://lore.kernel.org/all/20240215133633.25420-1-dsterba@suse.com/

1693d5442c45 btrfs: add and use helper to check if block group is used
f4a9f219411f btrfs: do not delete unused block group if it may be used soon
12c5128f101b btrfs: add new unused block groups to the list of unused block groups
2f6397e448e6 btrfs: don't refill whole delayed refs block reserve when starting transaction