mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
ZTS: normalize on use of sync_pool and sync_all_pools
- Replaces use of manual `zpool sync` - Don't use `log_must sync_pool` as `sync_pool` uses it internally - Replace many (but not all) uses of `sync` with `sync_pool` This makes the tests more consistent, and makes searching easier. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Allan Jude <allan@klarasystems.com> Closes #12894
This commit is contained in:
@@ -595,7 +595,7 @@ function list_file_blocks # input_file
|
||||
else
|
||||
AWK='awk'
|
||||
fi
|
||||
log_must zpool sync -f
|
||||
sync_all_pools true
|
||||
zdb -dddddd $ds $objnum | $AWK -v pad=$((4<<20)) -v bs=512 '
|
||||
/^$/ { looking = 0 }
|
||||
looking {
|
||||
|
||||
@@ -3104,6 +3104,7 @@ function datasetcksum
|
||||
{
|
||||
typeset cksum
|
||||
sync
|
||||
sync_all_pools
|
||||
cksum=$(zdb -vvv $1 | grep "^Dataset $1 \[" | grep "cksum" \
|
||||
| awk -F= '{print $7}')
|
||||
echo $cksum
|
||||
@@ -3519,6 +3520,24 @@ function sync_pool #pool <force>
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# Sync all pools
|
||||
#
|
||||
# $1 boolean to force uberblock (and config including zpool cache file) update
|
||||
#
|
||||
function sync_all_pools #<force>
|
||||
{
|
||||
typeset force=${1:-false}
|
||||
|
||||
if [[ $force == true ]]; then
|
||||
log_must zpool sync -f
|
||||
else
|
||||
log_must zpool sync
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# Wait for zpool 'freeing' property drops to zero.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user