From 16a32ce4026bdd08d4482c80bd49415144603fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Tue, 21 Dec 2021 18:38:30 +0100 Subject: [PATCH] module: zfs: dnode: use debug-only in debug mode only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #12844 --- module/zfs/dnode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c index db1a5d71df..658b556095 100644 --- a/module/zfs/dnode.c +++ b/module/zfs/dnode.c @@ -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) {