diff --git a/WHATS_NEW b/WHATS_NEW index a96f488c7..afb1b6535 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.03.11 - ================================== + Improve estimation of needed extents when creating thin-pool. Use extra 1% when resizing thin-pool metadata LV with --use-policy. Enhance --use-policy percentage rounding. Configure --with-vdo and --with-writecache as internal segments. diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 70ac8a799..d1389d725 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -1837,12 +1837,12 @@ static int _sufficient_pes_free(struct alloc_handle *ah, struct dm_list *pvms, { uint32_t area_extents_needed = (extents_still_needed - allocated) * ah->area_count / ah->area_multiple; uint32_t parity_extents_needed = (extents_still_needed - allocated) * ah->parity_count / ah->area_multiple; - uint32_t metadata_extents_needed = ah->alloc_and_split_meta ? 0 : ah->metadata_area_count * RAID_METADATA_AREA_LEN; /* One each */ - uint32_t total_extents_needed = area_extents_needed + parity_extents_needed + metadata_extents_needed; + uint32_t metadata_extents_needed = ah->alloc_and_split_meta ? 0 : ah->metadata_area_count * RAID_METADATA_AREA_LEN + ah->log_len; /* One each */ + uint64_t total_extents_needed = (uint64_t)area_extents_needed + parity_extents_needed + metadata_extents_needed; uint32_t free_pes = pv_maps_size(pvms); if (total_extents_needed > free_pes) { - log_error("Insufficient free space: %" PRIu32 " extents needed," + log_error("Insufficient free space: %" PRIu64 " extents needed," " but only %" PRIu32 " available", total_extents_needed, free_pes); return 0;