aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/include/libtest.shlib
diff options
context:
space:
mode:
authorLOLi <[email protected]>2017-05-03 18:31:05 +0200
committerBrian Behlendorf <[email protected]>2017-05-03 09:31:05 -0700
commitdddef7d600580ea35177299fe8394f665cc13387 (patch)
tree980db4683bb602f8ef7925739517563520d8b357 /tests/zfs-tests/include/libtest.shlib
parent9d3f7b87919b7d0d869153ca72844f565cd0bf52 (diff)
More ashift improvements
This commit allow higher ashift values (up to 16) in 'zpool create' The ashift value was previously limited to 13 (8K block) in b41c990 because the limited number of uberblocks we could fit in the statically sized (128K) vdev label ring buffer could prevent the ability the safely roll back a pool to recover it. Since b02fe35 the largest uberblock size we support is 8K: this allow us to store a minimum number of 16 uberblocks in the vdev label, even with higher ashift values. Additionally change 'ashift' pool property behaviour: if set it will be used as the default hint value in subsequent vdev operations ('zpool add', 'attach' and 'replace'). A custom ashift value can still be specified from the command line, if desired. Finally, fix a bug in add-o_ashift.ksh caused by a missing variable. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #2024 Closes #4205 Closes #4740 Closes #5763
Diffstat (limited to 'tests/zfs-tests/include/libtest.shlib')
-rw-r--r--tests/zfs-tests/include/libtest.shlib38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib
index 07cf9a1e6..aafc47b2b 100644
--- a/tests/zfs-tests/include/libtest.shlib
+++ b/tests/zfs-tests/include/libtest.shlib
@@ -1825,6 +1825,29 @@ function snapshot_mountpoint
}
#
+# Given a device and 'ashift' value verify it's correctly set on every label
+#
+function verify_ashift # device ashift
+{
+ typeset device="$1"
+ typeset ashift="$2"
+
+ zdb -e -lll $device | awk -v ashift=$ashift '/ashift: / {
+ if (ashift != $2)
+ exit 1;
+ else
+ count++;
+ } END {
+ if (count != 4)
+ exit 1;
+ else
+ exit 0;
+ }'
+
+ return $?
+}
+
+#
# Given a pool and file system, this function will verify the file system
# using the zdb internal tool. Note that the pool is exported and imported
# to ensure it has consistent state.
@@ -3220,6 +3243,21 @@ function wait_freeing #pool
}
#
+# Wait for every device replace operation to complete
+#
+# $1 pool name
+#
+function wait_replacing #pool
+{
+ typeset pool=${1:-$TESTPOOL}
+ while true; do
+ [[ "" == "$(zpool status $pool |
+ awk '/replacing-[0-9]+/ {print $1}')" ]] && break
+ log_must sleep 1
+ done
+}
+
+#
# Check if ZED is currently running, if not start ZED.
#
function zed_start