diff options
author | Chris Mason <chris.mason@fusionio.com> | 2013-01-29 15:41:40 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-02-01 10:52:00 -0500 |
commit | 6f082141d0a608c286c3f1b42ddd558e72ea1d9f (patch) | |
tree | 12ddd8839215f132ebbf8f4bdded1e6bffa871ba /extent-tree.c | |
parent | 8fe354744cd7b5c4f7a3314dcdbb5095192a032f (diff) | |
download | btrfs-progs-6f082141d0a608c286c3f1b42ddd558e72ea1d9f.tar.gz |
Fix alignment during allocations
We need to align earlier to make sure we're getting things
properly setup against the raid56 stripes.
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'extent-tree.c')
-rw-r--r-- | extent-tree.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/extent-tree.c b/extent-tree.c index 20cdffa..c712117 100644 --- a/extent-tree.c +++ b/extent-tree.c @@ -2408,6 +2408,8 @@ static int noinline find_free_extent(struct btrfs_trans_handle *trans, WARN_ON(num_bytes < root->sectorsize); btrfs_set_key_type(ins, BTRFS_EXTENT_ITEM_KEY); + search_start = stripe_align(root, search_start); + if (hint_byte) { block_group = btrfs_lookup_first_block_group(info, hint_byte); if (!block_group) @@ -2423,6 +2425,7 @@ static int noinline find_free_extent(struct btrfs_trans_handle *trans, total_needed += empty_size; check_failed: + search_start = stripe_align(root, search_start); if (!block_group) { block_group = btrfs_lookup_first_block_group(info, search_start); @@ -2435,7 +2438,6 @@ check_failed: if (ret) goto error; - search_start = stripe_align(root, search_start); ins->objectid = search_start; ins->offset = num_bytes; |