ZTS: Fix zfs_create_013_pos

It's possible for an unrelated process, like blkid, to have the
volume open when 'zfs destroy' is run.  Switch the cleanup function
to the destroy_dataset() helper which handles this case by retrying
the destroy when the dataset is busy.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7847
This commit is contained in:
Brian Behlendorf 2018-08-30 13:38:09 -07:00 committed by GitHub
parent c3bd3fb4ac
commit 6c6949acae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,8 +48,7 @@ function cleanup
{
typeset -i j=0
while [[ $j -lt ${#size[*]} ]]; do
datasetexists $TESTPOOL/${LONGFSNAME}${size[j]} && \
log_must zfs destroy $TESTPOOL/${LONGFSNAME}${size[j]}
destroy_dataset $TESTPOOL/${LONGFSNAME}${size[j]}
((j = j + 1))
done
}