]> granicus.if.org Git - zfs/commitdiff
Incorrect maximum DVA value in DDE_GET_NDVAS()
authorTim Chase <tim@chase2k.com>
Mon, 26 Feb 2018 22:20:12 +0000 (16:20 -0600)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 26 Feb 2018 22:20:12 +0000 (14:20 -0800)
The conditional was reversed which caused garbage values to be used when
calculating dds_ref_dsize.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Tim Chase <tim@chase2k.com>
Closes #7234

include/sys/ddt.h

index fc40a495ac16907ced0a8ba68cd74fd5b9aee840..fb1445d8d4b08d0e4573fb4f4cd9ed0f996f675e 100644 (file)
@@ -95,7 +95,7 @@ typedef struct ddt_key {
 #define        DDT_KEY_WORDS   (sizeof (ddt_key_t) / sizeof (uint64_t))
 
 #define        DDE_GET_NDVAS(dde) (DDK_GET_CRYPT(&dde->dde_key) \
-       ? SPA_DVAS_PER_BP : SPA_DVAS_PER_BP - 1)
+       ? SPA_DVAS_PER_BP - 1 : SPA_DVAS_PER_BP)
 
 typedef struct ddt_phys {
        dva_t           ddp_dva[SPA_DVAS_PER_BP];