• Yan Zheng's avatar
    Btrfs: update backrefs while dropping snapshot · 2c47e605
    Yan Zheng authored
    The new backref format has restriction on type of backref item.  If a tree
    block isn't referenced by its owner tree, full backrefs must be used for the
    pointers in it. When a tree block loses its owner tree's reference, backrefs
    for the pointers in it should be updated to full backrefs. Current
    btrfs_drop_snapshot misses the code that updates backrefs, so it's unsafe for
    general use.
    This patch adds backrefs update code to btrfs_drop_snapshot.  It isn't a
    problem in the restricted form btrfs_drop_snapshot is used today, but for
    general snapshot deletion this update is required.
    Signed-off-by: default avatarYan Zheng <zheng.yan@oracle.com>
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>