diff --git a/module/os/macos/spl/spl-taskq.c b/module/os/macos/spl/spl-taskq.c index 7f8e57039..5bff27fb5 100644 --- a/module/os/macos/spl/spl-taskq.c +++ b/module/os/macos/spl/spl-taskq.c @@ -1684,7 +1684,10 @@ taskq_empty(taskq_t *tq) int taskq_empty_ent(taskq_ent_t *t) { - return (IS_EMPTY(*t)); + if (t->tqent_prev == NULL && t->tqent_next == NULL) + return (TRUE); + else + return (IS_EMPTY(*t)); } /* diff --git a/module/os/macos/zfs/ldi_iokit.cpp b/module/os/macos/zfs/ldi_iokit.cpp index 3699f391b..8f6c864f3 100644 --- a/module/os/macos/zfs/ldi_iokit.cpp +++ b/module/os/macos/zfs/ldi_iokit.cpp @@ -423,17 +423,19 @@ handle_sync_iokit(struct ldi_handle *lhp) #if defined(MAC_OS_X_VERSION_10_11) && \ (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11) + /* from module/os/macos/zfs/zfs_vfsops.c */ + extern uint64_t zfs_vfs_sync_paranoia; /* Issue device sync */ - if (LH_MEDIA(lhp)->synchronize(LH_CLIENT(lhp), 0, 0, kIOStorageSynchronizeOptionBarrier) != - kIOReturnSuccess) { - printf("%s %s\n", __func__, - "IOMedia synchronizeCache (with write barrier) failed\n"); - if (LH_MEDIA(lhp)->synchronize(LH_CLIENT(lhp), 0, 0, 0) != - kIOReturnSuccess) { - printf("%s %s\n", __func__, - "IOMedia synchronizeCache (standard) failed\n"); - return (ENOTSUP); - } + IOStorageSynchronizeOptions synctype = (zfs_vfs_sync_paranoia != 0) + ? kIOStorageSynchronizeOptionNone + : kIOStorageSynchronizeOptionBarrier; + IOReturn ret = LH_MEDIA(lhp)->synchronize(LH_CLIENT(lhp), + 0, 0, synctype); + if (ret != kIOReturnSuccess) { + printf("%s %s %d %s\n", __func__, + "IOMedia synchronizeCache (with write barrier) failed", + ret, "(see IOReturn.h)\n"); + return (ENOTSUP); } #else /* Issue device sync */