Fix unallocated space calculation in the presence of LVM RAID partitions.
BUG: 396776
This commit is contained in:
parent
8b28001ae2
commit
4fcbb540e0
|
@ -402,6 +402,13 @@ void PartitionTable::insertUnallocated(const Device& d, PartitionNode* p, qint64
|
|||
}
|
||||
}
|
||||
|
||||
if (d.type() == Device::Type::LVM_Device)
|
||||
{
|
||||
const LvmDevice& lvm = static_cast<const LvmDevice&>(d);
|
||||
p->insert(createUnallocated(d, *p, lastEnd, lastEnd + lvm.freePE() - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Take care of the free space between the end of the last child and the end
|
||||
// of the device or the extended partition.
|
||||
qint64 parentEnd = lastUsable();
|
||||
|
@ -414,6 +421,7 @@ void PartitionTable::insertUnallocated(const Device& d, PartitionNode* p, qint64
|
|||
|
||||
if (parentEnd >= firstUsable() && parentEnd >= lastEnd)
|
||||
p->insert(createUnallocated(d, *p, lastEnd, parentEnd));
|
||||
}
|
||||
}
|
||||
|
||||
/** Updates the unallocated Partitions for this PartitionTable.
|
||||
|
|
Loading…
Reference in New Issue