This patchset will add the BTRFS_IOC_SUBVOL_UNDELETE ioctl for online btrfs subvolume undelete.
And using the online_undelete version of btrfs-progs, user can recover the subvolume given by <subvol_id> to the directory given by <dest>. The optional parameter [-n <name>] can be used to set the name of the recovered subvolume. # btrfs subvolume undelete [-n <name>] <subvol_id> <dest> btrfs online undelete version: https://github.com/littleroad/linux.git undelete btrfs-progs online undelete version: https://github.com/littleroad/btrfs-progs.git online_undelete Issue: #82 Lu Fengqi (4): btrfs: factor out btrfs_link_subvol from create_subvol btrfs: don't BUG_ON() in btrfs_link_subvol() btrfs: undelete: introduce btrfs_undelete_subvolume btrfs: undelete: Add BTRFS_IOCTL_SUBVOL_UNDELETE ioctl fs/btrfs/ioctl.c | 247 +++++++++++++++++++++++++++++++++---- include/uapi/linux/btrfs.h | 7 ++ 2 files changed, 231 insertions(+), 23 deletions(-) -- 2.18.0