summaryrefslogtreecommitdiffstats
path: root/debian/patches/align-new-partitions-on-fresh-disks.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:16:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:16:35 +0000
commit0658a8b1efc58836eb6674a1b0aadfbdf0e54755 (patch)
treee1d58d026a886d854c9e01cb4a683ad81fcb6e59 /debian/patches/align-new-partitions-on-fresh-disks.patch
parentAdding upstream version 3.6. (diff)
downloadparted-5f25aca0c0b52328a9d904cdbc44e2ff773be05f.tar.xz
parted-5f25aca0c0b52328a9d904cdbc44e2ff773be05f.zip
Adding debian version 3.6-3.debian/3.6-3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/align-new-partitions-on-fresh-disks.patch')
-rw-r--r--debian/patches/align-new-partitions-on-fresh-disks.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/debian/patches/align-new-partitions-on-fresh-disks.patch b/debian/patches/align-new-partitions-on-fresh-disks.patch
new file mode 100644
index 0000000..c37bfe0
--- /dev/null
+++ b/debian/patches/align-new-partitions-on-fresh-disks.patch
@@ -0,0 +1,45 @@
+From 8b6f34acaadd78d11415144dccf5c4750e3e1d0e Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@ubuntu.com>
+Date: Wed, 6 Aug 2014 16:07:28 +0200
+Subject: Align new partitions created on fresh disks
+
+Commit fa815ad05db248d78ef214ea79a78c22772a9ffe arranged to skip
+partition alignment while reading disks, but also has the effect of
+skipping partition alignment when creating a partition on a fresh disk,
+which is incorrect.
+
+The proper upstream fix probably involves adding a new member to PedDisk
+to keep track of whether we're in the middle of the initial read in
+ped_disk_new or not. To avoid changing ABI, we instead take this hacky
+approach of overloading an extra bit on PedDisk.needs_clobber.
+
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1352252
+Forwarded: no
+Last-Update: 2023-06-26
+
+Patch-Name: align-new-partitions-on-fresh-disks.patch
+---
+ libparted/disk.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libparted/disk.c b/libparted/disk.c
+index 0db7b5c9..2d6b9d49 100644
+--- a/libparted/disk.c
++++ b/libparted/disk.c
+@@ -198,6 +198,7 @@ ped_disk_new (PedDevice* dev)
+ disk = ped_disk_new_fresh (dev, type);
+ if (!disk)
+ goto error_close_dev;
++ disk->needs_clobber |= 2;
+ if (!type->ops->read (disk))
+ goto error_destroy_disk;
+ disk->needs_clobber = 0;
+@@ -951,7 +952,7 @@ _partition_align (PedPartition* part, const PedConstraint* constraint)
+ PED_ASSERT (disk_type->ops->partition_align != NULL);
+ PED_ASSERT (part->disk->update_mode);
+
+- if (part->disk->needs_clobber)
++ if ((part->disk->needs_clobber & 2) != 0 || !constraint)
+ return 1; /* do not attempt to align partitions while reading them */
+ return disk_type->ops->partition_align (part, constraint);
+ }