module: zfs: dnode: use debug-only in debug mode only

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12844
This commit is contained in:
наб 2021-12-21 18:38:30 +01:00 committed by Brian Behlendorf
parent 83719bd68c
commit 16a32ce402
1 changed files with 2 additions and 0 deletions

View File

@ -1621,7 +1621,9 @@ dnode_rele_and_unlock(dnode_t *dn, void *tag, boolean_t evicting)
* other direct or indirect hold on the dnode must first drop the dnode
* handle.
*/
#ifdef ZFS_DEBUG
ASSERT(refs > 0 || dnh->dnh_zrlock.zr_owner != curthread);
#endif
/* NOTE: the DNODE_DNODE does not have a dn_dbuf */
if (refs == 0 && db != NULL) {