+ /*
+ * The numbers of copies written must always be greater than or
+ * equal to the threshold set by the dedupditto property. This
+ * is initialized in ztest_run() and then randomly changed by
+ * ztest_spa_prop_get_set(), these function will never set it
+ * larger than 2 * ZIO_DEDUPDITTO_MIN.
+ */
+ int copies = 2 * ZIO_DEDUPDITTO_MIN;
+
+ /*
+ * The block size is limited by DMU_MAX_ACCESS (64MB) which
+ * caps the maximum transaction size. A block size of up to
+ * SPA_OLD_MAXBLOCKSIZE is allowed which results in a maximum
+ * transaction size of: 128K * 200 (copies) = ~25MB
+ *
+ * The actual block size is checked here, rather than requested
+ * above, because the way ztest_od_init() is implemented it does
+ * not guarantee the block size requested will be used.
+ */
+ if (blocksize > SPA_OLD_MAXBLOCKSIZE) {
+ (void) pthread_rwlock_unlock(&ztest_name_lock);
+ umem_free(od, sizeof (ztest_od_t));
+ return;
+ }
+