Btrfs: Avoid recursive chunk allocations
authorChris Mason <chris.mason@oracle.com>
Sat, 26 Apr 2008 15:03:32 +0000 (11:03 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:04:02 +0000 (11:04 -0400)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent-tree.c

index 6540095544e843eccbf29c69f219e0557163557d..a589912fdd51aaa2d6ea727352196d02fbf2b53f 100644 (file)
@@ -1727,7 +1727,7 @@ int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
                data = BTRFS_BLOCK_GROUP_METADATA | alloc_profile;
        }
 again:
-       if (root != root->fs_info->extent_root) {
+       if (root->ref_cows) {
                if (!(data & BTRFS_BLOCK_GROUP_METADATA)) {
                        ret = do_chunk_alloc(trans, root->fs_info->extent_root,
                                             2 * 1024 * 1024,