aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 6137f06091e8..54f2b1d8bdfd 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2501,6 +2501,7 @@ int btrfs_grow_extent_tree(struct btrfs_trans_handle *trans,
2501 u64 nr = 0; 2501 u64 nr = 0;
2502 u64 cur_byte; 2502 u64 cur_byte;
2503 u64 old_size; 2503 u64 old_size;
2504 unsigned long rem;
2504 struct btrfs_block_group_cache *cache; 2505 struct btrfs_block_group_cache *cache;
2505 struct btrfs_block_group_item *item; 2506 struct btrfs_block_group_item *item;
2506 struct btrfs_fs_info *info = root->fs_info; 2507 struct btrfs_fs_info *info = root->fs_info;
@@ -2538,7 +2539,8 @@ int btrfs_grow_extent_tree(struct btrfs_trans_handle *trans,
2538 struct btrfs_block_group_item); 2539 struct btrfs_block_group_item);
2539 2540
2540 btrfs_set_disk_block_group_used(leaf, item, 0); 2541 btrfs_set_disk_block_group_used(leaf, item, 0);
2541 if (nr % 3) { 2542 div_long_long_rem(nr, 3, &rem);
2543 if (rem) {
2542 btrfs_set_disk_block_group_flags(leaf, item, 2544 btrfs_set_disk_block_group_flags(leaf, item,
2543 BTRFS_BLOCK_GROUP_DATA); 2545 BTRFS_BLOCK_GROUP_DATA);
2544 } else { 2546 } else {