Skip to content

Commit

Permalink
Merge pull request #3673 from mulkieran/simplify-integrity
Browse files Browse the repository at this point in the history
Use total size when calculating integrity metadata
  • Loading branch information
mulkieran authored Aug 16, 2024
2 parents a5cdc20 + 3d433ab commit 67dac76
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/engine/strat_engine/backstore/data_tier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ impl DataTier<v2::StratBlockDev> {
pub fn new(mut block_mgr: BlockDevMgr<v2::StratBlockDev>) -> DataTier<v2::StratBlockDev> {
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,
Expand Down

0 comments on commit 67dac76

Please sign in to comment.