]> 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>
Sun, 8 Dec 2019 03:18:35 +0000 (22:18 -0500)
(cherry picked from commit 1d9c5ddd8e5e71c9aeeca8cc516ed713ce0281b9)

fs/btrfs/relocation.c

index 0395b8233c905d214db3f538ad25fa1e6911f409..3ded9fc4dd5f6696964b0d4c200c0cbf01688f0c 100644 (file)
@@ -4655,6 +4655,11 @@ int btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans,
        if (!root->reloc_root)
                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;