From 3d433ab9591c7b6674bf57a45ab8a2e1d0098ec7 Mon Sep 17 00:00:00 2001 From: mulhern Date: Tue, 13 Aug 2024 22:07:56 -0400 Subject: [PATCH] Use total size when calculating integrity metadata This will allot slightly more bytes than actually necessary for the integrity checksums, but it keeps all the calculations simple. Signed-off-by: mulhern --- src/engine/strat_engine/backstore/data_tier.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/engine/strat_engine/backstore/data_tier.rs b/src/engine/strat_engine/backstore/data_tier.rs index 840a9c707e..ec0cce5fc9 100644 --- a/src/engine/strat_engine/backstore/data_tier.rs +++ b/src/engine/strat_engine/backstore/data_tier.rs @@ -108,12 +108,10 @@ impl DataTier { pub fn new(mut block_mgr: BlockDevMgr) -> DataTier { for (_, bd) in block_mgr.blockdevs_mut() { bd.alloc_raid_meta(raid_meta_space()); - bd.alloc_int_meta_back(integrity_meta_space( - // NOTE: Subtracting metadata size works here because the only metadata currently - // recorded in a newly created block device is the BDA. If this becomes untrue in - // the future, this code will no longer work. - bd.total_size().sectors() - bd.metadata_size(), - )); + // NOTE: over-allocates integrity metadata slightly. Some of the + // total size of the device will not make use of the integrity + // metadata. + bd.alloc_int_meta_back(integrity_meta_space(bd.total_size().sectors())); } DataTier { block_mgr,