Skip to content

Commit c0d6119

Browse files
committed
Add two more db_mtx acquisitions
These weren't necessary originally, but after rebasing they are.
1 parent 71ee218 commit c0d6119

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

module/zfs/dnode.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,11 +2208,14 @@ dnode_dirty_l1range(dnode_t *dn, uint64_t start_blkid, uint64_t end_blkid,
22082208
if (db == NULL)
22092209
db = avl_nearest(&dn->dn_dbufs, where, AVL_AFTER);
22102210
for (; db != NULL; db = AVL_NEXT(&dn->dn_dbufs, db)) {
2211-
ASSERT(MUTEX_HELD(&db->db_mtx));
2212-
if (db->db_level != 1 || db->db_blkid >= end_blkid)
2211+
mutex_enter(&db->db_mtx);
2212+
if (db->db_level != 1 || db->db_blkid >= end_blkid) {
2213+
mutex_exit(&db->db_mtx);
22132214
break;
2215+
}
22142216
if (db->db_state != DB_EVICTING)
22152217
ASSERT(db->db_dirtycnt > 0);
2218+
mutex_exit(&db->db_mtx);
22162219
}
22172220
#endif
22182221
kmem_free(db_search, sizeof (dmu_buf_impl_t));

module/zfs/dnode_sync.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,9 @@ free_children(dmu_buf_impl_t *db, uint64_t blkid, uint64_t nblks,
308308
* last L1 indirect blocks are always dirtied by dnode_free_range().
309309
*/
310310
db_lock_type_t dblt = dmu_buf_lock_parent(db, RW_READER, FTAG);
311-
ASSERT(MUTEX_HELD(&db->db_mtx));
311+
mutex_enter(&db->db_mtx);
312312
VERIFY(BP_GET_FILL(db->db_blkptr) == 0 || db->db_dirtycnt > 0);
313+
mutex_exit(&db->db_mtx);
313314
dmu_buf_unlock_parent(db, dblt, FTAG);
314315

315316
dbuf_release_bp(db);

0 commit comments

Comments
 (0)