mirror_zfs/module
Alek P 931deb290c
Prevent range tree corruption race by updating dnode_sync()
Switch to incremental range tree processing in dnode_sync() to avoid
unsafe lock dropping during zfs_range_tree_walk(). This also ensures
the free ranges remain visible to dnode_block_freed() throughout the
sync process, preventing potential stale data reads.

This patch:
 - Keeps the range tree attached during processing for visibility.
 - Processes segments one-by-one by restarting from the tree head.
 - Uses zfs_range_tree_clear() to safely handle ranges that may have
   been modified while the lock was dropped.
 - adds ASSERT()s to document that we don't expect dn_free_ranges
   modification outside of sync context.

Reviewed-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alek Pinchuk <apinchuk@axcient.com>
Issue #18186
Closes #18235
2026-03-23 18:34:19 -07:00
..
avl Prefer VERIFY0P(n) over VERIFY(n == NULL) 2025-08-07 11:41:37 -07:00
icp Fix check for .cfi_negate_ra_state on aarch64 2026-03-06 11:04:37 -08:00
lua SPDX: license tags: MIT 2025-03-13 17:56:54 -07:00
nvpair nvpair: chase FreeBSD xdrproc_t definition 2026-01-28 21:41:33 -05:00
os linux/super: flatten zpl_fill_super into zpl_get_tree 2026-03-18 12:00:38 -07:00
zcommon Convert all HAVE_<name> SIMD gates to HAVE_SIMD(<name>) 2026-03-05 15:01:37 -08:00
zfs Prevent range tree corruption race by updating dnode_sync() 2026-03-23 18:34:19 -07:00
zstd Zstd: Document update policy 2026-01-20 13:41:24 -08:00
.gitignore FreeBSD: Ignore symlink to i386 includes 2022-08-02 16:34:23 -07:00
Kbuild.in Add simd_config.h and HAVE_SIMD() selector 2026-03-05 15:01:42 -08:00
Makefile.bsd Add simd_config.h and HAVE_SIMD() selector 2026-03-05 15:01:42 -08:00
Makefile.in Fix --enable-invariants on FreeBSD 2026-01-14 14:54:12 -08:00