Page MenuHomeFreeBSD

D61527.1795433570.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61527.1795433570.diff

diff --git a/sys/contrib/openzfs/module/zfs/dbuf.c b/sys/contrib/openzfs/module/zfs/dbuf.c
--- a/sys/contrib/openzfs/module/zfs/dbuf.c
+++ b/sys/contrib/openzfs/module/zfs/dbuf.c
@@ -1484,6 +1484,13 @@
* find frees from TXGs before the override, which should not make
* the block appear freed. Instead, check only free ranges from
* TXGs after the override.
+ *
+ * Otherwise, recheck BP_IS_HOLE() after dnode_block_freed():
+ * dnode_sync_free_ranges() clears the bp before it removes the
+ * free range, and free_blocks() does not take the parent's
+ * db_rwlock for blkptrs held in the dnode. If we wait for dn_mtx
+ * while that happens, block_freed says "no" but bp is now a hole,
+ * which must not be handed to arc_read().
*/
if (!is_hole && db->db_level == 0) {
dbuf_dirty_record_t *dr = list_head(&db->db_dirty_records);
@@ -1492,7 +1499,8 @@
is_hole = dnode_block_freed_after(dn,
db->db_blkid, dr->dr_txg);
} else {
- is_hole = dnode_block_freed(dn, db->db_blkid);
+ is_hole = dnode_block_freed(dn, db->db_blkid) ||
+ BP_IS_HOLE(bp);
}
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 23, 11:32 AM (11 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41736798
Default Alt Text
D61527.1795433570.diff (1 KB)

Event Timeline