mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 11:10:44 +00:00
scoutfs: clear seg rb node after replacing
When inserting a newly allocated segment we might find an existing cached stale segment. We replace it in the cache so that its user can keep using its stale contents while we work on the new segment. Replacing doesn't clear the rb_node, though, so we trip over a warning when we finally free the segment and it looks like it's still present in the rb tree. Clear the node after we replace it so that freeing sees a clear node and doesn't issue a warning. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -182,6 +182,7 @@ static struct scoutfs_segment *replace_seg(struct segment_cache *cac,
|
||||
node = &(*node)->rb_right;
|
||||
} else {
|
||||
rb_replace_node(&seg->node, &ins->node, root);
|
||||
RB_CLEAR_NODE(&seg->node);
|
||||
lru_check(cac, seg);
|
||||
lru_check(cac, ins);
|
||||
found = seg;
|
||||
|
||||
Reference in New Issue
Block a user