diff options
author | Matthew Ahrens <[email protected]> | 2015-05-19 22:14:01 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-06-10 16:24:01 -0700 |
commit | c3520e7f1f567bd4e6a28eff4867c70850e8a854 (patch) | |
tree | fa4841c8118ce6129ee4931d868dd015d60a7643 /cmd/ztest | |
parent | 9c43027b3f18769f2ace16eaa222ac8b301501f4 (diff) |
Illumos 5818 - zfs {ref}compressratio is incorrect with 4k sector size
5818 zfs {ref}compressratio is incorrect with 4k sector size
Reviewed by: Alex Reece <[email protected]>
Reviewed by: George Wilson <[email protected]>
Reviewed by: Richard Elling <[email protected]>
Reviewed by: Steven Hartland <[email protected]>
Approved by: Albert Lee <[email protected]>
References:
https://www.illumos.org/issues/5818
https://github.com/illumos/illumos-gate/commit/81cd5c5
Ported-by: Don Brady <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #3432
Diffstat (limited to 'cmd/ztest')
-rw-r--r-- | cmd/ztest/ztest.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 1dfc25b6a..f1a8ff61d 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -1022,21 +1022,6 @@ ztest_random_spa_version(uint64_t initial_version) return (version); } -/* - * Find the largest ashift used - */ -static uint64_t -ztest_spa_get_ashift(void) { - uint64_t i; - uint64_t ashift = SPA_MINBLOCKSHIFT; - vdev_t *rvd = ztest_spa->spa_root_vdev; - - for (i = 0; i < rvd->vdev_children; i++) { - ashift = MAX(ashift, rvd->vdev_child[i]->vdev_ashift); - } - return (ashift); -} - static int ztest_random_blocksize(void) { @@ -1047,7 +1032,8 @@ ztest_random_blocksize(void) int maxbs = SPA_OLD_MAXBLOCKSHIFT; if (spa_maxblocksize(ztest_spa) == SPA_MAXBLOCKSIZE) maxbs = 20; - uint64_t block_shift = ztest_random(maxbs - ztest_spa_get_ashift() + 1); + uint64_t block_shift = + ztest_random(maxbs - ztest_spa->spa_max_ashift + 1); return (1 << (SPA_MINBLOCKSHIFT + block_shift)); } |