The partition-is-big-enough-for-child test did not work correctly; the

partition offset doesn't belong there (caused it to hide nested partitions)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4718 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2003-09-17 01:02:26 +00:00
parent 14b537e142
commit 070bba8608
2 changed files with 2 additions and 4 deletions
@@ -180,8 +180,7 @@ amiga_rdb_scan_partition(int fd, partition_data *partition, void *_cookie)
disk_environment &environment = *(disk_environment *)&partitionBlock.environment[0]; disk_environment &environment = *(disk_environment *)&partitionBlock.environment[0];
TRACE(("amiga_rdb: file system: %s\n", get_tupel(B_BENDIAN_TO_HOST_INT32(environment.dos_type)))); TRACE(("amiga_rdb: file system: %s\n", get_tupel(B_BENDIAN_TO_HOST_INT32(environment.dos_type))));
if ((uint64)partition->offset + environment.Start() if (environment.Start() + environment.Size() > (uint64)partition->size) {
+ environment.Size() > (uint64)partition->size) {
TRACE(("amiga_rdb: child partition exceeds existing space (%Ld bytes)\n", environment.Size())); TRACE(("amiga_rdb: child partition exceeds existing space (%Ld bytes)\n", environment.Size()));
continue; continue;
} }
@@ -157,8 +157,7 @@ apple_scan_partition(int fd, partition_data *partition, void *_cookie)
TRACE(("apple: found partition: name = \"%s\", type = \"%s\"\n", TRACE(("apple: found partition: name = \"%s\", type = \"%s\"\n",
partitionMap.name, partitionMap.type)); partitionMap.name, partitionMap.type));
if ((uint64)partition->offset + partitionMap.Start(descriptor) if (partitionMap.Start(descriptor) + partitionMap.Size(descriptor) > (uint64)partition->size) {
+ partitionMap.Size(descriptor) > (uint64)partition->size) {
TRACE(("apple: child partition exceeds existing space (%Ld bytes)\n", TRACE(("apple: child partition exceeds existing space (%Ld bytes)\n",
partitionMap.Size(descriptor))); partitionMap.Size(descriptor)));
continue; continue;