- Truncate the previous partition if the current partition's offset lies within the previous partitions area.

- Fixed spelling mistake.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38970 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Bryce Groff
2010-10-15 07:24:16 +00:00
parent 7fab61455e
commit 7813cb23eb
@@ -833,11 +833,20 @@ PartitionMap::Check(off_t sessionSize) const
off_t nextOffset = 0; off_t nextOffset = 0;
for (int32 i = 0; i < byOffsetCount; i++) { for (int32 i = 0; i < byOffsetCount; i++) {
const Partition* partition = byOffset[i]; const Partition* partition = byOffset[i];
if (partition->Offset() < nextOffset) { if (partition->Offset() < nextOffset && i > 0) {
TRACE(("intel: PartitionMap::Check(): overlapping partitions!" Partition* previousPartition = (Partition*)byOffset[i - 1];
"\n")); off_t previousSize = previousPartition->Size()
result = false; - (nextOffset - partition->Offset());
break; TRACE(("intel: PartitionMap::Check(): "));
if (previousSize == 0) {
previousPartition->Unset();
TRACE(("partition offset hides previous partition."
" Removing previous partition from disk layout.\n"));
} else {
TRACE(("overlapping partitions! Setting partition %ld "
"size to %lld\n", i - 1, previousSize));
previousPartition->SetSize(previousSize);
}
} }
nextOffset = partition->Offset() + partition->Size(); nextOffset = partition->Offset() + partition->Size();
} }
@@ -847,7 +856,7 @@ PartitionMap::Check(off_t sessionSize) const
if (result) { if (result) {
for (int32 i = 0; i < tableOffsetCount; i++) { for (int32 i = 0; i < tableOffsetCount; i++) {
if (i > 0 && tableOffsets[i] == tableOffsets[i - 1]) { if (i > 0 && tableOffsets[i] == tableOffsets[i - 1]) {
TRACE(("intel: PartitionMap::Check(): same partition talbe " TRACE(("intel: PartitionMap::Check(): same partition table "
"for different extended partitions!\n")); "for different extended partitions!\n"));
result = false; result = false;
break; break;