mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
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) inb41c990because 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. Sinceb02fe35the 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 <behlendorf1@llnl.gov> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes #2024 Closes #4205 Closes #4740 Closes #5763
This commit is contained in:
@@ -1824,6 +1824,29 @@ function snapshot_mountpoint
|
||||
echo $(get_prop mountpoint $fs)/.zfs/snapshot/$snap
|
||||
}
|
||||
|
||||
#
|
||||
# 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
|
||||
@@ -3219,6 +3242,21 @@ function wait_freeing #pool
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user