mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Introduce a destroy_dataset helper
Datasets can be busy when calling zfs destroy. Introduce a helper function to destroy datasets and use it to destroy datasets in zfs_allow_004_pos, zfs_promote_008_pos, and zfs_destroy_002_pos. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov> Closes #7224 Closes #7246 Closes #7249 Closes #7267
This commit is contained in:
committed by
Brian Behlendorf
parent
2705ebf0a7
commit
c7b55e71b0
@@ -53,15 +53,11 @@ function cleanup_user_group
|
||||
#
|
||||
function restore_root_datasets
|
||||
{
|
||||
if datasetexists $ROOT_TESTFS ; then
|
||||
log_must zfs destroy -Rf $ROOT_TESTFS
|
||||
fi
|
||||
destroy_dataset "$ROOT_TESTFS" "-Rf"
|
||||
log_must zfs create $ROOT_TESTFS
|
||||
|
||||
if is_global_zone ; then
|
||||
if datasetexists $ROOT_TESTVOL ; then
|
||||
log_must zfs destroy -Rf $ROOT_TESTVOL
|
||||
fi
|
||||
destroy_dataset "$ROOT_TESTVOL" "-Rf"
|
||||
log_must zfs create -V $VOLSIZE $ROOT_TESTVOL
|
||||
block_device_wait
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user