Skip to content

Commit

Permalink
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.

Signed-off-by: Yuxin Wang <yuxinwang9999@gmail.com>
  • Loading branch information
Bi11 authored and macgo-dev committed Feb 10, 2024
1 parent 79c6dff commit f30e023
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 @@ -1837,7 +1837,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 f30e023

Please sign in to comment.