From: Chris Mason Date: Tue, 5 Feb 2008 15:20:17 +0000 (-0500) Subject: Btrfs: Add checks for last byte in disk to allocator grouping X-Git-Tag: firefly_0821_release~15789^2~11^2~55^2~56^2~30^2~293 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=068fe39fa18e8921062e2e16e6aa2b46768b2a35;p=firefly-linux-kernel-4.4.55.git Btrfs: Add checks for last byte in disk to allocator grouping Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a340eeedd6c7..9e0869959cde 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: