- 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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user