From b3c259d990167ee8c64b58237cafdb8a7a005bfe Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 12 Aug 2024 15:34:54 -0400 Subject: [PATCH] Round up to the nearest eight sectors !4095 instead of !4096. Signed-off-by: mulhern --- src/engine/strat_engine/backstore/blockdev/v2.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/strat_engine/backstore/blockdev/v2.rs b/src/engine/strat_engine/backstore/blockdev/v2.rs index 68dd643842..70ca42119f 100644 --- a/src/engine/strat_engine/backstore/blockdev/v2.rs +++ b/src/engine/strat_engine/backstore/blockdev/v2.rs @@ -46,10 +46,11 @@ use crate::{ /// This is a slight overestimation for the sake of simplicity. Because it uses the whole disk /// size, once the integrity metadata size is calculated, the remaining data size is now smaller /// than the metadata region could support for integrity. +/// The result is divisible by 8 sectors. pub fn integrity_meta_space(total_space: Sectors) -> Sectors { Bytes(4096).sectors() + Bytes::from(64 * IEC::Mi).sectors() - + Bytes::from((*total_space * 32u64 + 4095) & !4096).sectors() + + Bytes::from((*total_space * 32u64 + 4095) & !4095).sectors() } /// Return the amount of space required for RAID for a device of the given size.