From 3c2a42fd254917db78484c428bd317ec7189c968 Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Thu, 20 Jun 2019 18:30:40 -0700 Subject: [PATCH] dedup=verify doesn't clear the blkptr's dedup flag 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 Reviewed-by: Brian Behlendorf Signed-off-by: Matthew Ahrens External-issue: DLPX-48097 Closes #8936 --- module/zfs/zio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 5bfff37eb3b5..f9503bd3ff81 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -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);