]> git.hungrycats.org Git - linux/commitdiff
zygo: btrfs: check for dead roots
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Tue, 3 Dec 2019 16:31:55 +0000 (11:31 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sat, 7 Dec 2019 01:12:42 +0000 (20:12 -0500)
(cherry picked from commit 1d9c5ddd8e5e71c9aeeca8cc516ed713ce0281b9)

fs/btrfs/relocation.c

index 64b818f9f315835a9543a56907293f2dc6b01e34..457a5743f7189ad361ac0b605586216d843cd9da 100644 (file)
@@ -4792,6 +4792,11 @@ int btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans,
        if (!root->reloc_root || !rc)
                return 0;
 
+       if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->reloc_root->state)) {
+               WARN_ON(1);
+               return 0;
+       }
+
        rc = root->fs_info->reloc_ctl;
        rc->merging_rsv_size += rc->nodes_relocated;