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
@@ -791,6 +791,15 @@ dsl_dataset_rele_flags(dsl_dataset_t *ds, ds_hold_flags_t flags, void *tag)
|
||||
(flags & DS_HOLD_FLAG_DECRYPT)) {
|
||||
(void) spa_keystore_remove_mapping(ds->ds_dir->dd_pool->dp_spa,
|
||||
ds->ds_object, ds);
|
||||
|
||||
/*
|
||||
* Encrypted datasets require that users only release their
|
||||
* decrypting reference after the dirty data has actually
|
||||
* been written out. This ensures that the mapping exists
|
||||
* when it is needed to write out dirty data.
|
||||
*/
|
||||
ASSERT(dmu_buf_user_refcount(ds->ds_dbuf) != 0 ||
|
||||
!dsl_dataset_is_dirty(ds));
|
||||
}
|
||||
|
||||
dmu_buf_rele(ds->ds_dbuf, tag);
|
||||
|
||||
Reference in New Issue
Block a user