From 851aa99c899e5d7ddc937e223359b8892eeeca5d Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 12 Jun 2017 09:45:32 -0700 Subject: [PATCH] Use log_must_busy in destroy_pool The log function log_must_busy was added in commit e623aea2 for this purpose. Update destroy_pool to use it. Reviewed-by: Giuseppe Di Natale Reviewed-by: George Melikov Signed-off-by: Brian Behlendorf Closes #6217 --- tests/zfs-tests/include/libtest.shlib | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index df6b94f58..5d8500ddf 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -1496,20 +1496,11 @@ function destroy_pool #pool if poolexists "$pool" ; then mtpt=$(get_prop mountpoint "$pool") - # At times, syseventd activity can cause attempts to - # destroy a pool to fail with EBUSY. We retry a few + # At times, syseventd/udev activity can cause attempts + # to destroy a pool to fail with EBUSY. We retry a few # times allowing failures before requiring the destroy # to succeed. - typeset -i wait_time=10 ret=1 count=0 - must="" - while [[ $ret -ne 0 ]]; do - $must zpool destroy -f $pool - ret=$? - [[ $ret -eq 0 ]] && break - log_note "zpool destroy failed with $ret" - [[ count++ -ge 7 ]] && must=log_must - sleep $wait_time - done + log_must_busy zpool destroy -f $pool [[ -d $mtpt ]] && \ log_must rm -rf $mtpt