Avoid mounting images inside images (inside images (inside images...)).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26996 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -222,6 +222,7 @@ Partition::AddChild()
|
||||
status_t
|
||||
Partition::_Mount(file_system_module_info *module, Directory **_fileSystem)
|
||||
{
|
||||
static int fileMapDiskDepth = 0;
|
||||
TRACE(("%p Partition::_Mount check for file_system: %s\n",
|
||||
this, module->pretty_name));
|
||||
|
||||
@@ -236,13 +237,16 @@ Partition::_Mount(file_system_module_info *module, Directory **_fileSystem)
|
||||
|
||||
fIsFileSystem = true;
|
||||
|
||||
// see if it contains an image file we could mount in turn
|
||||
// XXX: avoid recursing too much
|
||||
FileMapDisk *disk = FileMapDisk::FindAnyFileMapDisk(fileSystem);
|
||||
if (disk) {
|
||||
TRACE(("%p Partition::_Mount: found FileMapDisk\n", this));
|
||||
add_partitions_for(disk, true, false);
|
||||
// if we aren't already mounting an image
|
||||
if (!fileMapDiskDepth++) {
|
||||
// see if it contains an image file we could mount in turn
|
||||
FileMapDisk *disk = FileMapDisk::FindAnyFileMapDisk(fileSystem);
|
||||
if (disk) {
|
||||
TRACE(("%p Partition::_Mount: found FileMapDisk\n", this));
|
||||
add_partitions_for(disk, true, false);
|
||||
}
|
||||
}
|
||||
fileMapDiskDepth--;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user