@gyakovlev:
revert: https://github.com/openzfs/zfs/commit/0156253d29a303bdcca3e535958e754d8f086e33
due to: https://github.com/openzfs/zfs/issues/14413
--- b/module/zfs/zio.c
+++ a/module/zfs/zio.c
@@ -2827,7 +2827,7 @@
 	 * have a third copy.
 	 */
 	gbh_copies = MIN(copies + 1, spa_max_replication(spa));
+	if (gio->io_prop.zp_encrypt && gbh_copies >= SPA_DVAS_PER_BP)
-	if (BP_IS_ENCRYPTED(bp) && gbh_copies >= SPA_DVAS_PER_BP)
 		gbh_copies = SPA_DVAS_PER_BP - 1;
 
 	int flags = METASLAB_HINTBP_FAVOR | METASLAB_GANG_HEADER;
