btrfs: remove unnecessary extent root check in btrfs_defrag_leaves
authorJosef Bacik <josef@toxicpanda.com>
Fri, 5 Nov 2021 20:45:40 +0000 (16:45 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 3 Jan 2022 14:09:48 +0000 (15:09 +0100)
We only defrag leaves on roots that have SHAREABLE set, so we don't need
to check if we're the extent root as it doesn't have SHAREABLE set.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-defrag.c

index 7c45d96..b6cf39f 100644 (file)
@@ -27,14 +27,6 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
        int next_key_ret = 0;
        u64 last_ret = 0;
 
-       if (root->fs_info->extent_root == root) {
-               /*
-                * there's recursion here right now in the tree locking,
-                * we can't defrag the extent root without deadlock
-                */
-               goto out;
-       }
-
        if (!test_bit(BTRFS_ROOT_SHAREABLE, &root->state))
                goto out;