Skip to content

Commit 2b5ce77

Browse files
vojtechtrefnyalxvmr
authored andcommitted
Fix restore on Linux with latest UDisks/libblockdev (FedoraQt#647)
The newly created partition cannot start on offset 0, previously UDisks was able to compensate for this, but there is a bug in the latest UDisks/libblockdev and this no longer works. But in general offset 0 for a new partition doesn't make sense. We can also use 0 for size to let UDisks calculate the maximal size instead of passing the underlying device size. Fixes: FedoraQt#644
1 parent a1699b6 commit 2b5ce77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

helper/linux/restorejob.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void RestoreJob::work() {
7777
}
7878

7979
QDBusInterface partitionTable("org.freedesktop.UDisks2", where, "org.freedesktop.UDisks2.PartitionTable", QDBusConnection::systemBus(), this);
80-
QDBusReply<QDBusObjectPath> partitionReply = partitionTable.call("CreatePartition", 0ULL, device.property("Size").toULongLong(), "", "", Properties());
80+
QDBusReply<QDBusObjectPath> partitionReply = partitionTable.call("CreatePartition", 1ULL, 0ULL, "", "", Properties());
8181
if (!partitionReply.isValid()) {
8282
err << partitionReply.error().message();
8383
err.flush();

0 commit comments

Comments
 (0)