From cf2838a3ebaa8066cbaa930ff6342563de2da85b Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 26 Feb 2025 17:08:59 -0500 Subject: [PATCH] BFS: Write-lock the stream inode in BPlusTree::MakeEmpty(). I was experimenting with forcing the CheckVisitor to always rebuild all indices, when I got a KDL from a Tracker process that I had running a query in the background. The fault address was invalid (0x7b4493418), and the stack trace was bfs_read_query -> GetNextMatching -> TreeIterator::Traverse. That method read-locks inodes, and it looks like query references to inodes are managed correctly. This seems like the most plausible culprit for missing locks. I didn't manage to reproduce the KDL, unfortunately, but hopefully this resolves it nonetheless. --- src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp b/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp index f1569c2c79..419839feda 100644 --- a/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp @@ -853,6 +853,7 @@ BPlusTree::MakeEmpty() { // Put all nodes into the free list in order Transaction transaction(fStream->GetVolume(), fStream->BlockNumber()); + fStream->WriteLockInTransaction(transaction); // Reset the header, and root node CachedNode cached(this);