diff --git a/module/zfs/spa_history.c b/module/zfs/spa_history.c index de036d6c3718..040909bb4024 100644 --- a/module/zfs/spa_history.c +++ b/module/zfs/spa_history.c @@ -535,6 +535,9 @@ log_internal(nvlist_t *nvl, const char *operation, spa_t *spa, fnvlist_add_uint64(nvl, ZPOOL_HIST_TXG, tx->tx_txg); fnvlist_add_uint64(nvl, ZPOOL_HIST_TIME, gethrestime_sec()); + VERIFY3UF(tx->tx_txg, <=, spa_final_dirty_txg(spa), + "Logged after final txg was set: %s %s", operation, fmt); + if (dmu_tx_is_syncing(tx)) { spa_history_log_sync(nvl, tx); } else {