From: Zygo Blaxell Date: Tue, 3 Dec 2019 16:31:55 +0000 (-0500) Subject: zygo: btrfs: check for dead roots X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be7f1587feddf14a9070e7ccddc9e1d9d343f830;p=linux zygo: btrfs: check for dead roots (cherry picked from commit 1d9c5ddd8e5e71c9aeeca8cc516ed713ce0281b9) --- diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 0395b8233c90..3ded9fc4dd5f 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -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;