aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Snajdr <[email protected]>2024-11-26 00:37:56 +0100
committerGitHub <[email protected]>2024-11-25 18:37:56 -0500
commitd2b0ca953f16d7b33f747369fceb55a89eb51b2e (patch)
tree39c35a578a36692a4508dbcc1b690d8b10031f9e
parentd0a91b9f88a47316158508bf304a61baa8c99c10 (diff)
Assert if we're logging after final txg was set
This allowed to debug #16714, fixed in #16782. Without assertions added here it is difficult to figure out what logs cause the problem, since the assertion happens in sync thread context. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pavel Snajdr <[email protected]> Co-authored-by: Alexander Motin <[email protected]> Closes #16795
-rw-r--r--module/zfs/spa_history.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/module/zfs/spa_history.c b/module/zfs/spa_history.c
index de036d6c3..81bb99eb2 100644
--- a/module/zfs/spa_history.c
+++ b/module/zfs/spa_history.c
@@ -390,6 +390,9 @@ spa_history_log_nvl(spa_t *spa, nvlist_t *nvl)
return (err);
}
+ ASSERT3UF(tx->tx_txg, <=, spa_final_dirty_txg(spa),
+ "Logged %s after final txg was set!", "nvlist");
+
VERIFY0(nvlist_dup(nvl, &nvarg, KM_SLEEP));
if (spa_history_zone() != NULL) {
fnvlist_add_string(nvarg, ZPOOL_HIST_ZONE,
@@ -527,6 +530,9 @@ log_internal(nvlist_t *nvl, const char *operation, spa_t *spa,
return;
}
+ ASSERT3UF(tx->tx_txg, <=, spa_final_dirty_txg(spa),
+ "Logged after final txg was set: %s %s", operation, fmt);
+
msg = kmem_vasprintf(fmt, adx);
fnvlist_add_string(nvl, ZPOOL_HIST_INT_STR, msg);
kmem_strfree(msg);