On 1/25/21 9:24 PM, Naohiro Aota wrote:
Conventional zones do not have a write pointer, so we cannot use it to
determine the allocation offset if a block group contains a conventional
zone.
But instead, we can consider the end of the last allocated extent in the
block group as an allocation offset.
For new block group, we cannot calculate the allocation offset by
consulting the extent tree, because it can cause deadlock by taking extent
buffer lock after chunk mutex (which is already taken in
btrfs_make_block_group()). Since it is a new block group, we can simply set
the allocation offset to 0, anyway.
Signed-off-by: Naohiro Aota <naohiro.a...@wdc.com>
Reviewed-by: Josef Bacik <jo...@toxicpanda.com>
Thanks,
Josef