]> granicus.if.org Git - zfs/commitdiff
dedup=verify doesn't clear the blkptr's dedup flag
authorMatthew Ahrens <mahrens@delphix.com>
Fri, 21 Jun 2019 01:30:40 +0000 (18:30 -0700)
committerTony Hutter <hutter2@llnl.gov>
Wed, 25 Sep 2019 18:27:48 +0000 (11:27 -0700)
The logic to handle strong checksum collisions where the data doesn't
match is incorrect. It is not clearing the dedup bit of the blkptr,
which can cause a panic later in zio_ddt_free() due to the dedup table
not matching what is in the blkptr.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
External-issue: DLPX-48097
Closes #8936

module/zfs/zio.c

index 5bfff37eb3b59a0120125e285256d8f335e25a59..f9503bd3ff8146fa36e1f3a422415b2cc45cf68b 100644 (file)
@@ -3192,7 +3192,9 @@ zio_ddt_write(zio_t *zio)
                        BP_ZERO(bp);
                } else {
                        zp->zp_dedup = B_FALSE;
+                       BP_SET_DEDUP(bp, B_FALSE);
                }
+               ASSERT(!BP_GET_DEDUP(bp));
                zio->io_pipeline = ZIO_WRITE_PIPELINE;
                ddt_exit(ddt);
                return (zio);