aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-02-05 10:20:17 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:00 -0400
commit068fe39fa18e8921062e2e16e6aa2b46768b2a35 (patch)
tree604770af3b7d650dc1c184649e9e91ecd8824354
parentdacb473ad81d5c1650cb73d1cb9b866202f6bab0 (diff)
Btrfs: Add checks for last byte in disk to allocator grouping
Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r--fs/btrfs/extent-tree.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index a340eeedd6c..9e0869959cd 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -1611,8 +1611,13 @@ check_pending:
}
ins->offset = num_bytes;
btrfs_free_path(path);
- if (last_ptr)
+ if (last_ptr) {
*last_ptr = ins->objectid + ins->offset;
+ if (*last_ptr ==
+ btrfs_super_total_bytes(&root->fs_info->super_copy)) {
+ *last_ptr = 0;
+ }
+ }
return 0;
new_group: