mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 11:47:43 +03:00
Add ASSERT to debug encryption key mapping issues
This patch simply adds an ASSERT that confirms that the last decrypting reference on a dataset waits until the dataset is no longer dirty. This should help to debug issues where the ZIO layer cannot find encryption keys after a dataset has been disowned. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tom Caputi <tcaputi@datto.com> Closes #7637
This commit is contained in:
committed by
Brian Behlendorf
parent
517d247192
commit
cd32e5db8b
@@ -3306,6 +3306,20 @@ dbuf_refcount(dmu_buf_impl_t *db)
|
||||
return (refcount_count(&db->db_holds));
|
||||
}
|
||||
|
||||
uint64_t
|
||||
dmu_buf_user_refcount(dmu_buf_t *db_fake)
|
||||
{
|
||||
uint64_t holds;
|
||||
dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake;
|
||||
|
||||
mutex_enter(&db->db_mtx);
|
||||
ASSERT3U(refcount_count(&db->db_holds), >=, db->db_dirtycnt);
|
||||
holds = refcount_count(&db->db_holds) - db->db_dirtycnt;
|
||||
mutex_exit(&db->db_mtx);
|
||||
|
||||
return (holds);
|
||||
}
|
||||
|
||||
void *
|
||||
dmu_buf_replace_user(dmu_buf_t *db_fake, dmu_buf_user_t *old_user,
|
||||
dmu_buf_user_t *new_user)
|
||||
|
||||
Reference in New Issue
Block a user