Script to automate repair of corrupted btrfs units that cannot be mounted, mainly due to child eb corrupted errors, but may work in other cases, bypassing the corrupted pieces of data by restoring a tree before those were written. Proof-of-concept for LinuxToys.
WARNING: there will be some data loss even on a successful recovery, depending on how bad the data corruption was.