DDT: Add locking for table ZAP destruction

Similar to BRT, DDT ZAP can be destroyed by sync context when it
becomes empty.  Respectively similar to BRT introduce RW-lock to
protect open context methods from the destruction.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes #18115
This commit is contained in:
Alexander Motin
2026-01-13 18:07:15 -05:00
committed by GitHub
parent 1051c3d211
commit 765929cb4e
2 changed files with 79 additions and 23 deletions
+3
View File
@@ -284,6 +284,9 @@ typedef struct {
avl_tree_t ddt_tree; /* "live" (changed) entries this txg */
avl_tree_t ddt_repair_tree; /* entries being repaired */
/* Protects ddt_object[] and ddt_object_dnode[]. */
krwlock_t ddt_objects_lock ____cacheline_aligned;
/*
* Log trees are stable during I/O, and only modified during sync
* with exclusive access.