]> git.proxmox.com Git - mirror_zfs.git/commitdiff
BRT: Fix slop space calculation with block cloning
authorBi11 <Bi11gates9999@gmail.com>
Mon, 12 Feb 2024 21:53:33 +0000 (05:53 +0800)
committerGitHub <noreply@github.com>
Mon, 12 Feb 2024 21:53:33 +0000 (13:53 -0800)
Similar to deduplication, the size of data duplicated by block cloning
should not be included in the slop space calculation.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Yuxin Wang <yuxinwang9999@gmail.com>
Closes #15874

module/zfs/spa_misc.c

index 1e5ab59eb4d06ed25ce32ee86c9e6a4a19d62770..68b907614196b6a6ca69815342a9ca3eba370eeb 100644 (file)
@@ -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);
 
        /*