Skip to content

Commit

Permalink
BRT: Fix slop space calculation with block cloning
Browse files Browse the repository at this point in the history
Similar to deduplication, the size of data duplicated by block cloning
should not be included in the slop space calculation.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Yuxin Wang <[email protected]>
Closes #15874
  • Loading branch information
Bi11 authored and tonyhutter committed Feb 12, 2024
1 parent 36116b4 commit fc3d34b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/zfs/spa_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,8 @@ spa_get_slop_space(spa_t *spa)
* deduplicated data, so since it's not useful to reserve more
* space with more deduplicated data, we subtract that out here.
*/
space = spa_get_dspace(spa) - spa->spa_dedup_dspace;
space =
spa_get_dspace(spa) - spa->spa_dedup_dspace - brt_get_dspace(spa);
slop = MIN(space >> spa_slop_shift, spa_max_slop);

/*
Expand Down

0 comments on commit fc3d34b

Please sign in to comment.