mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 11:18:52 +03:00
More aggressively assert that db_mtx protects db.db_data
db.db_mtx must be held any time that db.db_data is accessed. All of these functions do have the lock held by a parent; add assertions to ensure that it stays that way. See https://github.com/openzfs/zfs/discussions/17118 * Refactor dbuf_read_bonus to make it obvious why db_rwlock isn't required. * Refactor dbuf_hold_copy to eliminate the db_rwlock Copy data into the newly allocated buffer before assigning it to the db. That way, there will be no need to take db->db_rwlock. * Refactor dbuf_read_hole In the case of an indirect hole, initialize the newly allocated buffer before assigning it to the dmu_buf_impl_t. Sponsored by: ConnectWise Signed-off-by: Alan Somers <asomers@gmail.com> Closes #17209
This commit is contained in:
@@ -2272,8 +2272,10 @@ dmu_objset_userquota_find_data(dmu_buf_impl_t *db, dmu_tx_t *tx)
|
||||
dbuf_dirty_record_t *dr;
|
||||
void *data;
|
||||
|
||||
if (db->db_dirtycnt == 0)
|
||||
if (db->db_dirtycnt == 0) {
|
||||
ASSERT(MUTEX_HELD(&db->db_mtx));
|
||||
return (db->db.db_data); /* Nothing is changing */
|
||||
}
|
||||
|
||||
dr = dbuf_find_dirty_eq(db, tx->tx_txg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user