git: 5d6bdb30a792 - stable/15 - dnode_sync: Relax constraint on indirect freeing
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 23 Nov 2026 15:01:21 UTC
The branch stable/15 has been updated by igoro:
URL: https://cgit.FreeBSD.org/src/commit/?id=5d6bdb30a792358efeb5a14255d399236627d6ef
commit 5d6bdb30a792358efeb5a14255d399236627d6ef
Author: Ryan Moeller <ryan.moeller@klarasystems.com>
AuthorDate: 2026-06-12 18:43:58 +0000
Commit: Igor Ostapenko <igoro@FreeBSD.org>
CommitDate: 2026-11-23 14:16:51 +0000
dnode_sync: Relax constraint on indirect freeing
One of the roles of the dnode sync thread is freeing. There are two
modes of this operation: freeing a portion of an object, and freeing
the object itself.
Freeing is handled by `free_children()`. This function verifies that
if the dnode has children there must be at least one marked as dirty
before proceeding to recursively free the tree of block pointers.
As described in a comment, this VERIFY is overly strict. In practice,
children may not be marked as dirty when the dnode itself is being
freed. Relax the VERIFY slightly by avoiding the VERIFY when indirect
blocks are to be immediately freed, to more closely match the comment
motivating the VERIFY.
While here, clarify the logic of the test by using VERIFY_IMPLY instead
of chaining multiple tests.
Sponsored-by: Cybersecure Pty Ltd
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Ryan Moeller <ryan.moeller@klarasystems.com>
Closes #18822
(cherry picked from commit 242105f01012bf07cc896a4fb5cdb1385ef58220)
---
sys/contrib/openzfs/module/zfs/dnode_sync.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sys/contrib/openzfs/module/zfs/dnode_sync.c b/sys/contrib/openzfs/module/zfs/dnode_sync.c
index 0e070c69dcd6..199ac045679d 100644
--- a/sys/contrib/openzfs/module/zfs/dnode_sync.c
+++ b/sys/contrib/openzfs/module/zfs/dnode_sync.c
@@ -305,9 +305,12 @@ free_children(dmu_buf_impl_t *db, uint64_t blkid, uint64_t nblks,
* ancestor of the first or last block to be freed. The first and
* last L1 indirect blocks are always dirtied by dnode_free_range().
*/
- db_lock_type_t dblt = dmu_buf_lock_parent(db, RW_READER, FTAG);
- VERIFY(BP_GET_FILL(db->db_blkptr) == 0 || db->db_dirtycnt > 0);
- dmu_buf_unlock_parent(db, dblt, FTAG);
+ if (!free_indirects) {
+ db_lock_type_t dblt = dmu_buf_lock_parent(db, RW_READER, FTAG);
+ VERIFY_IMPLY(BP_GET_FILL(db->db_blkptr) > 0,
+ db->db_dirtycnt > 0);
+ dmu_buf_unlock_parent(db, dblt, FTAG);
+ }
dbuf_release_bp(db);
bp = db->db.db_data;