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
This commit is contained in:
parent
29e0c99de5
commit
fc2f5c4f98
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user