Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use total size when calculating integrity metadata #3673

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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