Enhance a dmu_tx_dirty_buf() assertion

The following assertion is good to validate the correctness of
new DMU consumers, but it doesn't quite provide enough information.
Slightly rework the assertion so that when it is hit the actual
offending values will be included in the output.

  SPLError: 4787:0:(dmu_tx.c:828:dmu_tx_dirty_buf())
  ASSERTION(dn == NULL || dn->dn_assigned_txg == tx->tx_txg) failed

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Brian Behlendorf 2012-03-12 12:38:00 -07:00
parent 4b5d425f14
commit 99ea23c583

View File

@ -808,6 +808,7 @@ dmu_tx_dirty_buf(dmu_tx_t *tx, dmu_buf_impl_t *db)
DB_DNODE_ENTER(db); DB_DNODE_ENTER(db);
dn = DB_DNODE(db); dn = DB_DNODE(db);
ASSERT(dn != NULL);
ASSERT(tx->tx_txg != 0); ASSERT(tx->tx_txg != 0);
ASSERT(tx->tx_objset == NULL || dn->dn_objset == tx->tx_objset); ASSERT(tx->tx_objset == NULL || dn->dn_objset == tx->tx_objset);
ASSERT3U(dn->dn_object, ==, db->db.db_object); ASSERT3U(dn->dn_object, ==, db->db.db_object);
@ -825,7 +826,7 @@ dmu_tx_dirty_buf(dmu_tx_t *tx, dmu_buf_impl_t *db)
for (txh = list_head(&tx->tx_holds); txh; for (txh = list_head(&tx->tx_holds); txh;
txh = list_next(&tx->tx_holds, txh)) { txh = list_next(&tx->tx_holds, txh)) {
ASSERT(dn == NULL || dn->dn_assigned_txg == tx->tx_txg); ASSERT3U(dn->dn_assigned_txg, ==, tx->tx_txg);
if (txh->txh_dnode == dn && txh->txh_type != THT_NEWOBJECT) if (txh->txh_dnode == dn && txh->txh_type != THT_NEWOBJECT)
match_object = TRUE; match_object = TRUE;
if (txh->txh_dnode == NULL || txh->txh_dnode == dn) { if (txh->txh_dnode == NULL || txh->txh_dnode == dn) {