From 6539e234ff02161a4f943dcb42a7308c16e0e580 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 21 Nov 2024 19:56:45 +0100 Subject: [PATCH] Assert if we're logging after final txg was set This change was developed under this PR: https://github.com/openzfs/zfs/pull/16795 Signed-off-by: Pavel Snajdr --- module/zfs/spa_history.c | 3 +++ 1 file changed, 3 insertions(+) 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 {