Skip to content

Commit

Permalink
reset dnode_phys_t structures, generate new key mapping
Browse files Browse the repository at this point in the history
Signed-off-by: George Amanakis <[email protected]>
  • Loading branch information
gamanakis committed Mar 3, 2021
1 parent bf42548 commit 9132142
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion module/zfs/dnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,11 @@ dnode_rele_and_unlock(dnode_t *dn, void *tag, boolean_t evicting)
dmu_buf_impl_t *db = dn->dn_dbuf;
dnode_handle_t *dnh = dn->dn_handle;

refs = zfs_refcount_remove(&dn->dn_holds, tag);
if (zfs_refcount_count(&dn->dn_holds) > 0) {
refs = zfs_refcount_remove(&dn->dn_holds, tag);
} else {
refs = 0;
}
if (refs == 0)
cv_broadcast(&dn->dn_nodnholds);
mutex_exit(&dn->dn_mtx);
Expand Down
5 changes: 3 additions & 2 deletions module/zfs/dnode_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,11 @@ dnode_sync_free(dnode_t *dn, dmu_tx_t *tx)
ASSERT(dn->dn_type != DMU_OT_NONE);

ASSERT(dn->dn_free_txg > 0);
if (dn->dn_allocated_txg != dn->dn_free_txg)
if (dn->dn_allocated_txg != dn->dn_free_txg && &dn->dn_dbuf->db != NULL)
dmu_buf_will_dirty(&dn->dn_dbuf->db, tx);
bzero(dn->dn_phys, sizeof (dnode_phys_t) * dn->dn_num_slots);
dnode_free_interior_slots(dn);
if (&dn->dn_dbuf->db != NULL)
dnode_free_interior_slots(dn);

mutex_enter(&dn->dn_mtx);
dn->dn_type = DMU_OT_NONE;
Expand Down
2 changes: 2 additions & 0 deletions module/zfs/dsl_crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2136,6 +2136,8 @@ dsl_crypto_recv_raw_objset_sync(dsl_dataset_t *ds, dmu_objset_type_t ostype,
/* dsl_dataset_sync_done will drop this reference. */
dmu_buf_add_ref(ds->ds_dbuf, ds);
dsl_dataset_sync_done(ds, tx);

dsl_dataset_create_key_mapping(ds);
}
}

Expand Down

0 comments on commit 9132142

Please sign in to comment.