]> 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, 14 Dec 2019 04:53:06 +0000 (23:53 -0500)
(cherry picked from commit 1d9c5ddd8e5e71c9aeeca8cc516ed713ce0281b9)

fs/btrfs/relocation.c

index 1ceb461c5834470ce186d0cfdfef3fee27c5379c..b37b52cfaa0e7ed5614038c54e7f15ae9eab2a63 100644 (file)
@@ -4761,6 +4761,11 @@ int btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans,
            !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;