Skip to content

Commit

Permalink
Makd add and create consistent wrt. integrity meta allocation
Browse files Browse the repository at this point in the history
Calculate the integrity_meta_allocation the same whether the device is
being used on creation or is being added to the pool later.

Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Nov 27, 2024
1 parent 6486432 commit 3daccba
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/engine/strat_engine/backstore/data_tier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,7 @@ impl DataTier<v2::StratBlockDev> {
.collect::<Vec<_>>();
assert_eq!(bds.len(), uuids.len());
for bd in bds {
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(),
));
bd.alloc_int_meta_back(integrity_meta_space(bd.total_size().sectors()));
}
Ok(uuids)
}
Expand Down

0 comments on commit 3daccba

Please sign in to comment.