I cannot mount a BTRFS partition because its metadata store is too full.
The machine started complaining that the disk is full (it was the metadata) and while trying to fix the situation by running
balance in various forms (it wouldn't complete, because there was not enough space on the device, or it would get stuck in a loop and I would have to reboot the computer), I managed to make my partition unmountable. The logs say this when I try to mount:
error (device dm-0) in btrfs_drop_snapshot:5505: errno=-28 No space left failed to recover relocation: -28 open_ctree failed
All the relevant BTRFS commands seem to work on mounted filesystems only, so I can't help myself with those. I can't even delete a file to make more space.
I managed to mount the disk in readonly mode, so I have all the recent data rescued (the rest is on backups anyway), but I cannot repair the disk while it is mounted readonly and I would prefer if I didn't have to wipe the partition. I can at least inspect it now: I have 832.89MiB used out of 1.02GiB total metadata.
I even tried a variation of an advice I Googled: mounting the partition as readonly, then adding an additional memory disk partition to the BTRFS device to gain more space, and then remounting it as
rw, but it didn't work, unfortunately - same error.
EDIT: I needed that computer so I copied everything to another disk and recreated that partition. I won't be accepting answers as I can't test the solutions anymore, but suggestions will probably still be useful if somebody gets themselves into the same situation?