Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 068fe39f authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: Add checks for last byte in disk to allocator grouping

parent dacb473a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1611,8 +1611,13 @@ static int noinline find_free_extent(struct btrfs_trans_handle *trans,
	}
	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: