Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert if we're logging after final txg was set #16795

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions module/zfs/spa_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
Loading