summaryrefslogtreecommitdiff
path: root/usr/src/cmd/ztest
diff options
context:
space:
mode:
authorMatthew Ahrens <matt@mahrens.org>2014-11-07 08:30:07 -0800
committerChristopher Siden <chris@delphix.com>2014-11-07 08:30:07 -0800
commitb515258426fed6c7311fd3f1dea697cfbd4085c6 (patch)
treeb3b78065176c084e87197d4e6476adab58a114c6 /usr/src/cmd/ztest
parentf3477bb2505a35e160b09c9dbf5476112be4fa7d (diff)
downloadillumos-joyent-b515258426fed6c7311fd3f1dea697cfbd4085c6.tar.gz
5027 zfs large block support
Reviewed by: Alek Pinchuk <pinchuk.alek@gmail.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: Richard Elling <richard.elling@richardelling.com> Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com> Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/cmd/ztest')
-rw-r--r--usr/src/cmd/ztest/ztest.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr/src/cmd/ztest/ztest.c b/usr/src/cmd/ztest/ztest.c
index 6a29b2f32c..a5f9600804 100644
--- a/usr/src/cmd/ztest/ztest.c
+++ b/usr/src/cmd/ztest/ztest.c
@@ -985,9 +985,15 @@ ztest_spa_get_ashift() {
static int
ztest_random_blocksize(void)
{
- // Choose a block size >= the ashift.
- uint64_t block_shift =
- ztest_random(SPA_MAXBLOCKSHIFT - ztest_spa_get_ashift() + 1);
+ uint64_t block_shift;
+ /*
+ * Choose a block size >= the ashift.
+ * If the SPA supports new MAXBLOCKSIZE, test up to 1MB blocks.
+ */
+ int maxbs = SPA_OLD_MAXBLOCKSHIFT;
+ if (spa_maxblocksize(ztest_spa) == SPA_MAXBLOCKSIZE)
+ maxbs = 20;
+ block_shift = ztest_random(maxbs - ztest_spa_get_ashift() + 1);
return (1 << (SPA_MINBLOCKSHIFT + block_shift));
}
@@ -4787,7 +4793,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
char path0[MAXPATHLEN];
char pathrand[MAXPATHLEN];
size_t fsize;
- int bshift = SPA_MAXBLOCKSHIFT + 2; /* don't scrog all labels */
+ int bshift = SPA_OLD_MAXBLOCKSHIFT + 2; /* don't scrog all labels */
int iters = 1000;
int maxfaults;
int mirror_save;