[haiku-commits] haiku: hrev52904 - src/add-ons/kernel/file_systems/bfs

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 20 Feb 2019 11:25:48 -0500 (EST)

hrev52904 adds 1 changeset to branch 'master'
old head: 13c4bc94ca3471c50a0df6f1f7c89ecfae275854
new head: b08b51b4174d484fc43a4e70f3acdf92016987cf
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=b08b51b4174d+%5E13c4bc94ca34

----------------------------------------------------------------------------

b08b51b4174d: BFS: Fix vising attribute runs in FileSystemVisitor.
  
  See inline comment. Fixes "vnode refcount > 0" assert failures while
  running checkfs after yesterday's commits.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev52904
Commit:      b08b51b4174d484fc43a4e70f3acdf92016987cf
URL:         https://git.haiku-os.org/haiku/commit/?id=b08b51b4174d
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Wed Feb 20 16:24:15 2019 UTC

----------------------------------------------------------------------------

1 file changed, 7 insertions(+), 1 deletion(-)
src/add-ons/kernel/file_systems/bfs/FileSystemVisitor.cpp | 8 +++++++-

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/file_systems/bfs/FileSystemVisitor.cpp 
b/src/add-ons/kernel/file_systems/bfs/FileSystemVisitor.cpp
index c102f41ade..779f1ebae8 100644
--- a/src/add-ons/kernel/file_systems/bfs/FileSystemVisitor.cpp
+++ b/src/add-ons/kernel/file_systems/bfs/FileSystemVisitor.cpp
@@ -161,8 +161,14 @@ FileSystemVisitor::Next()
                // If the inode has an attribute directory that we want to 
visit,
                // push it on the stack
                if ((fFlags & VISIT_ATTRIBUTE_DIRECTORIES)
-                       && !inode->Attributes().IsZero()) {
+                               && !inode->Attributes().IsZero()) {
                        fStack.Push(inode->Attributes());
+
+                       // We may already be keeping the associated Vnode, so 
we can't
+                       // just call vnode.Keep() here, but rather acquire 
another reference
+                       // to it specifically.
+                       Vnode attrNode(fVolume, inode->Attributes());
+                       attrNode.Keep();
                }
 
                bool visitingCurrentDirectory = inode->BlockRun() == fCurrent;


Other related posts:

  • » [haiku-commits] haiku: hrev52904 - src/add-ons/kernel/file_systems/bfs - waddlesplash