In HMZONED BTRFS each BG maps to one (or more) zones on the device. As we cannot do random I/O within a zone, only appends, it may happen after a lot of CoW operations in the BG that we run out of space due to this constraint.
To overcome this we should add the stale blocks to a “to reclaim” list and if more than a specific threshold of the BG is marked as stale, copy the uptodate blocks into a new BG or add them to free space in a more empty BG and free the old BG again to reset the zone(s).
As functionality may even be useful for non-HMZONED filesystems, it should be driven by a mount option.
In HMZONED BTRFS each BG maps to one (or more) zones on the device. As we cannot do random I/O within a zone, only appends, it may happen after a lot of CoW operations in the BG that we run out of space due to this constraint.
To overcome this we should add the stale blocks to a “to reclaim” list and if more than a specific threshold of the BG is marked as stale, copy the uptodate blocks into a new BG or add them to free space in a more empty BG and free the old BG again to reset the zone(s).
As functionality may even be useful for non-HMZONED filesystems, it should be driven by a mount option.