aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorSerapheim Dimitropoulos <[email protected]>2023-08-25 10:28:36 -0700
committerBrian Behlendorf <[email protected]>2023-08-26 11:18:11 -0700
commitab999406fedf81439a6e307cbb538d77fd3a5dd1 (patch)
tree6f67b2175bc4c49274c59c48133caff20518ba41 /module/zfs
parentd19304ffeec50ebc02cf4496c14e8945c74fb76a (diff)
Update outdated assertion from zio_write_compress
As part of some internal gang block testing within Delphix we hit the assertion removed by this patch. The assertion was triggered by a ZIO that had two copies and was a gang block making the following expression equal to 3: ``` MIN(zp->zp_copies + BP_IS_GANG(bp), spa_max_replication(spa)) ``` and failing when we expected the above to be equal to `BP_GET_NDVAS(bp)`. The assertion is no longer valid since the following commit: ``` commit 14872aaa4f909d72c6b5e4105dadcfa13c7d9d66 Author: Matthew Ahrens <[email protected]> Date: Mon Feb 6 09:37:06 2023 -0800 EIO caused by encryption + recursive gang ``` The above commit changed gang block headers so they can't have more than 2 copies but the assertion in question from this PR was never updated. Reviewed-by: George Wilson <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Signed-off-by: Serapheim Dimitropoulos <[email protected]> Closes #15180
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/zio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/module/zfs/zio.c b/module/zfs/zio.c
index 7458b416c..3b3b40fa7 100644
--- a/module/zfs/zio.c
+++ b/module/zfs/zio.c
@@ -1775,8 +1775,9 @@ zio_write_compress(zio_t *zio)
compress = ZIO_COMPRESS_OFF;
/* Make sure someone doesn't change their mind on overwrites */
- ASSERT(BP_IS_EMBEDDED(bp) || MIN(zp->zp_copies + BP_IS_GANG(bp),
- spa_max_replication(spa)) == BP_GET_NDVAS(bp));
+ ASSERT(BP_IS_EMBEDDED(bp) || BP_IS_GANG(bp) ||
+ MIN(zp->zp_copies, spa_max_replication(spa))
+ == BP_GET_NDVAS(bp));
}
/* If it's a compressed write that is not raw, compress the buffer. */