Skip to content

Commit

Permalink
upstream: hack - retry destroy until diskarb goes away
Browse files Browse the repository at this point in the history
A more portable solution is perhaps desired.

Signed-off-by: Jorgen Lundman <lundman@lundman.net>
  • Loading branch information
lundman committed May 24, 2021
1 parent e4865cd commit f841cc2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/libzfs/libzfs_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -3849,7 +3849,24 @@ zfs_destroy(zfs_handle_t *zhp, boolean_t defer)
error = lzc_destroy_snaps(nv, defer, NULL);
fnvlist_free(nv);
} else {

#ifdef __APPLE__
/* DiskArbitrationd gets in the way a lot */
int retry = 0;
do {
if ((retry++) != 1) {
printf("retry\n");
sleep(1);
}
#endif

error = lzc_destroy(zhp->zfs_name);

#ifdef __APPLE__
} while ((error == EBUSY) && (retry <= 5));
#endif


}

if (error != 0 && error != ENOENT) {
Expand Down

0 comments on commit f841cc2

Please sign in to comment.