]> granicus.if.org Git - zfs/commitdiff
Use log_must_busy in destroy_pool
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 12 Jun 2017 16:45:32 +0000 (09:45 -0700)
committerGitHub <noreply@github.com>
Mon, 12 Jun 2017 16:45:32 +0000 (09:45 -0700)
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 <dinatale2@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6217

tests/zfs-tests/include/libtest.shlib

index df6b94f5802a453f156156c34241e99b6ffaa31b..5d8500ddfce1a3a8fcdedc6b9095740edb9adc3c 100644 (file)
@@ -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