diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2015-07-23 17:18:09 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-08-31 19:25:10 +0200 |
commit | 854437ca3c228d8ab3eb24d2efc1c21b5d56a635 (patch) | |
tree | 04fa30fba92b48bee53e8ca27dc43bc06abe5bba /extent-tree.c | |
parent | 595c57d2f4dd3199aacb23b4c68d6aff49f97d29 (diff) | |
download | btrfs-progs-854437ca3c228d8ab3eb24d2efc1c21b5d56a635.tar.gz |
btrfs-progs: extent-tree: avoid allocating tree block that crosses stripe boundary
Now find_free_extent() function won't return a metadata extent that
crosses stripe boundary.
Reported-by: Chris Murphy <lists@colorremedies.com>
Reported-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'extent-tree.c')
-rw-r--r-- | extent-tree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/extent-tree.c b/extent-tree.c index ac582e0..6f07e4b 100644 --- a/extent-tree.c +++ b/extent-tree.c @@ -2605,6 +2605,11 @@ check_failed: } if (!(data & BTRFS_BLOCK_GROUP_DATA)) { + if (check_crossing_stripes(ins->objectid, num_bytes)) { + search_start = round_down(ins->objectid + num_bytes, + BTRFS_STRIPE_LEN); + goto new_group; + } block_group = btrfs_lookup_block_group(info, ins->objectid); if (block_group) trans->block_group = block_group; |