From 5533f034e26a70b67d51bd1954a636783b3b15e4 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 17 Jan 2024 17:25:34 +0100 Subject: [PATCH] thin_pool: correct refactoring chunk_size Function to recalc chunk_size according to dev hints needs to be used after chunk_size is being set to thin pool segment - correct this ordering mistake introduced in previous refactoring commit. --- lib/metadata/thin_manip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c index 531ce6d3d..234241efe 100644 --- a/lib/metadata/thin_manip.c +++ b/lib/metadata/thin_manip.c @@ -783,6 +783,7 @@ int thin_pool_set_params(struct lv_segment *seg, thin_discards_t discards, thin_zero_t zero_new_blocks) { + seg->chunk_size = chunk_size; if (!recalculate_pool_chunk_size_with_dev_hints(seg->lv, seg_lv(seg, 0), thin_chunk_size_calc_policy)) return_0; @@ -793,7 +794,6 @@ int thin_pool_set_params(struct lv_segment *seg, if ((seg->crop_metadata = crop_metadata) == THIN_CROP_METADATA_NO) seg->lv->status |= LV_CROP_METADATA; - seg->chunk_size = chunk_size; seg->discards = discards; seg->zero_new_blocks = zero_new_blocks; seg->transaction_id = 0;