diff --git a/src/engine/strat_engine/backstore/backstore/v2.rs b/src/engine/strat_engine/backstore/backstore/v2.rs index c6d11639b2..4df219e600 100644 --- a/src/engine/strat_engine/backstore/backstore/v2.rs +++ b/src/engine/strat_engine/backstore/backstore/v2.rs @@ -888,6 +888,12 @@ impl Backstore { self.data_tier.metadata_size() } + /// Return the space used for crypt meta data. This space is rather hybrid, + /// because it is a component of allocated space but it is also metadata. + pub fn datatier_crypt_meta_size(&self) -> CryptMetaSize { + self.crypt_meta_allocs.as_slice().into() + } + /// Write the given data to the data tier's devices. pub fn save_state(&mut self, metadata: &[u8]) -> StratisResult<()> { self.data_tier.save_state(metadata) diff --git a/src/engine/strat_engine/pool/v2.rs b/src/engine/strat_engine/pool/v2.rs index 7bd9025efc..b57597d34d 100644 --- a/src/engine/strat_engine/pool/v2.rs +++ b/src/engine/strat_engine/pool/v2.rs @@ -1031,7 +1031,7 @@ impl Pool for StratPool { // event of, e.g, VDO, the amount will be far too large to be useful. self.thin_pool .total_physical_used() - .map(|u| u + self.metadata_size) + .map(|u| u + self.metadata_size + self.backstore.datatier_crypt_meta_size().sectors()) } fn filesystems(&self) -> Vec<(Name, FilesystemUuid, &dyn Filesystem)> {