From fc2f5c4f986c4a147c5b3f2bcf12cd191a98ef06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 29 Jan 2004 10:45:54 +0000 Subject: [PATCH] Fixed working with volume without indices - in case of a corrupt indices node the Inode will now be deleted, and it will only be tried to be instantiated if the indices block_run is not zeroed out. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6406 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Volume.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Volume.cpp b/src/add-ons/kernel/file_systems/bfs/Volume.cpp index 51983b6eed..d3db7f637f 100644 --- a/src/add-ons/kernel/file_systems/bfs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Volume.cpp @@ -363,7 +363,9 @@ Volume::Mount(const char *deviceName, uint32 flags) // volume in bfs_mount(), so bfs_read_vnode() can't get it. // But it's not needed to do that anyway. - fIndicesNode = new Inode(this, ToVnode(Indices())); + if (!Indices().IsZero()) + fIndicesNode = new Inode(this, ToVnode(Indices())); + if (fIndicesNode == NULL || fIndicesNode->InitCheck() < B_OK || !fIndicesNode->IsContainer()) { @@ -373,6 +375,7 @@ Volume::Mount(const char *deviceName, uint32 flags) // if this is the case, the index root node is gone bad, and // BFS switch to read-only mode fFlags |= VOLUME_READ_ONLY; + delete fIndicesNode; fIndicesNode = NULL; } }