aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dnode.c
diff options
context:
space:
mode:
authorPaul Dagnelie <[email protected]>2019-05-19 17:30:33 -0700
committerBrian Behlendorf <[email protected]>2019-05-19 17:30:33 -0700
commite61b53475e859bd055d205a4d9659f576a9765d1 (patch)
tree740d603933fd012b4a27ce3ef4ae20152ff98240 /module/zfs/dnode.c
parentf378f42b53382dc8e5a21dfad1a4d71271aba059 (diff)
Fix incorrect assertion in dnode_dirty_l1range
The db_dirtycnt of an EVICTING dbuf is always 0. However, it still appears in the dn_dbufs tree. If we call dnode_dirty_l1range on a range that contains an EVICTING dbuf, we will attempt to mark it dirty (which will fail because it's EVICTING, resulting in a new dbuf being created and dirtied). Later, in ZFS_DEBUG mode, we assert that all the dbufs in the range are dirty. If the EVICTING dbuf is still present, this will trip the assertion erroneously. Reviewed-by: Matt Ahrens <[email protected]> Reviewed-by: Richard Elling <[email protected]> Reviewed-by: Sara Hartse <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Closes #8745
Diffstat (limited to 'module/zfs/dnode.c')
-rw-r--r--module/zfs/dnode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c
index 38ec646ba..c06f614e1 100644
--- a/module/zfs/dnode.c
+++ b/module/zfs/dnode.c
@@ -1967,7 +1967,8 @@ dnode_dirty_l1range(dnode_t *dn, uint64_t start_blkid, uint64_t end_blkid,
for (; db != NULL; db = AVL_NEXT(&dn->dn_dbufs, db)) {
if (db->db_level != 1 || db->db_blkid >= end_blkid)
break;
- ASSERT(db->db_dirtycnt > 0);
+ if (db->db_state != DB_EVICTING)
+ ASSERT(db->db_dirtycnt > 0);
}
#endif
mutex_exit(&dn->dn_dbufs_mtx);