diff --git a/libparted-dasd-do-not-use-first-tracks.patch b/libparted-dasd-do-not-use-first-tracks.patch new file mode 100644 index 0000000..9ab13ad --- /dev/null +++ b/libparted-dasd-do-not-use-first-tracks.patch @@ -0,0 +1,18 @@ +--- + libparted/labels/dasd.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: parted-3.1/libparted/labels/dasd.c +=================================================================== +--- parted-3.1.orig/libparted/labels/dasd.c ++++ parted-3.1/libparted/labels/dasd.c +@@ -803,7 +803,8 @@ _primary_constraint (PedDisk* disk) + if (!ped_alignment_init (&end_align, -1, + disk->dev->hw_geom.sectors * sector_size)) + return NULL; +- if (!ped_geometry_init (&max_geom, disk->dev, 0, disk->dev->length)) ++ if (!ped_geometry_init (&max_geom, disk->dev, 2 * disk->dev->hw_geom.sectors * sector_size, ++ disk->dev->length - 2 * disk->dev->hw_geom.sectors * sector_size)) + return NULL; + + return ped_constraint_new(&start_align, &end_align, &max_geom, diff --git a/libparted-initialize-dasd-part-type.patch b/libparted-initialize-dasd-part-type.patch new file mode 100644 index 0000000..210ee20 --- /dev/null +++ b/libparted-initialize-dasd-part-type.patch @@ -0,0 +1,17 @@ +--- + libparted/labels/dasd.c | 2 ++ + 1 file changed, 2 insertions(+) + +Index: parted-3.1/libparted/labels/dasd.c +=================================================================== +--- parted-3.1.orig/libparted/labels/dasd.c ++++ parted-3.1/libparted/labels/dasd.c +@@ -659,6 +659,8 @@ dasd_partition_new (const PedDisk* disk, + goto error; + + part->disk_specific = ped_malloc (sizeof (DasdPartitionData)); ++ if (part->disk_specific) ++ memset(part->disk_specific, 0, sizeof(DasdPartitionData)); + return part; + + error: diff --git a/parted.changes b/parted.changes index 962361d..5403741 100644 --- a/parted.changes +++ b/parted.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Fri Feb 14 08:30:06 UTC 2014 - puzel@suse.com + +- Use BLKRRPART on DASD disks (instead of BLKPG_*) (bnc#862139) +- added patches: + * revert-libparted-remove-now-worse-than-useless-_kern.patch + * revert-linux-remove-DASD-restriction-on-_disk_sync_p.patch + +------------------------------------------------------------------- +Thu Feb 13 15:40:56 UTC 2014 - puzel@suse.com + +- reserve first 2 tracks on DASD disks for metadata (bnc#862138) + * add: libparted-dasd-do-not-use-first-tracks.patch +- initialize memory for newly allocated partition (bnc#862138) + * add: libparted-initialize-dasd-part-type.patch + ------------------------------------------------------------------- Fri Jan 24 13:17:34 UTC 2014 - puzel@suse.com diff --git a/parted.spec b/parted.spec index f291df8..fa8604b 100644 --- a/parted.spec +++ b/parted.spec @@ -56,6 +56,10 @@ Patch25: parted-Add-Intel-Rapid-Start-Technology-partition.patch Patch26: parted-btrfs-support.patch Patch27: parted-GPT-add-support-for-PReP-GUID.patch Patch28: parted-resize-command.patch +Patch29: libparted-dasd-do-not-use-first-tracks.patch +Patch30: libparted-initialize-dasd-part-type.patch +Patch31: revert-linux-remove-DASD-restriction-on-_disk_sync_p.patch +Patch32: revert-libparted-remove-now-worse-than-useless-_kern.patch Patch100: parted-fatresize-autoconf.patch Requires: /sbin/udevadm BuildRequires: check-devel @@ -132,6 +136,10 @@ to develop applications that require these. %patch26 -p1 %patch27 -p1 %patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 %patch100 -p1 %build diff --git a/revert-libparted-remove-now-worse-than-useless-_kern.patch b/revert-libparted-remove-now-worse-than-useless-_kern.patch new file mode 100644 index 0000000..0368c3d --- /dev/null +++ b/revert-libparted-remove-now-worse-than-useless-_kern.patch @@ -0,0 +1,59 @@ +From 59627048c1b5b6e6aed9198bb11c397b3ad8cddd Mon Sep 17 00:00:00 2001 +From: Petr Uzel +Date: Fri, 14 Feb 2014 09:18:32 +0100 +Subject: [PATCH] Revert "libparted: remove now-worse-than-useless + _kernel_reread_part_table" + +This reverts commit 1223b9fc07859cb619c80dc057bd05458f9b5669. +--- + libparted/arch/linux.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +Index: parted-3.1/libparted/arch/linux.c +=================================================================== +--- parted-3.1.orig/libparted/arch/linux.c ++++ parted-3.1/libparted/arch/linux.c +@@ -2897,6 +2897,34 @@ _dm_reread_part_table (PedDisk* disk) + #endif + + static int ++_kernel_reread_part_table (PedDevice* dev) ++{ ++ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); ++ int retry_count = 9; ++ ++ sync(); ++ while (ioctl (arch_specific->fd, BLKRRPART)) { ++ retry_count--; ++ sync(); ++ if (retry_count == 3) ++ sleep(1); /* Pause to allow system to settle */ ++ ++ if (!retry_count) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_IGNORE, ++ _("WARNING: the kernel failed to re-read the partition " ++ "table on %s (%s). As a result, it may not " ++ "reflect all of your changes until after reboot."), ++ dev->path, strerror (errno)); ++ return 0; ++ } ++ } ++ ++ return 1; ++} ++ ++static int + _have_blkpg () + { + static int have_blkpg = -1; +@@ -2931,6 +2959,8 @@ linux_disk_commit (PedDisk* disk) + ok = 0; + } + ++ if (!_kernel_reread_part_table (disk->dev)) ++ ok = 0; + return ok; + } + diff --git a/revert-linux-remove-DASD-restriction-on-_disk_sync_p.patch b/revert-linux-remove-DASD-restriction-on-_disk_sync_p.patch new file mode 100644 index 0000000..3653a8f --- /dev/null +++ b/revert-linux-remove-DASD-restriction-on-_disk_sync_p.patch @@ -0,0 +1,44 @@ +From 69cc320d6a8640dd8069e81ac02ee7d50fc1e8cd Mon Sep 17 00:00:00 2001 +From: Petr Uzel +Date: Fri, 14 Feb 2014 09:12:47 +0100 +Subject: [PATCH] Revert "linux: remove DASD restriction on + _disk_sync_part_table" + +This reverts commit 9fa0e1800db5b9f094ae481fd95a51da03f19e95. +--- + libparted/arch/linux.c | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +Index: parted-3.1/libparted/arch/linux.c +=================================================================== +--- parted-3.1.orig/libparted/arch/linux.c ++++ parted-3.1/libparted/arch/linux.c +@@ -2919,15 +2919,20 @@ linux_disk_commit (PedDisk* disk) + return _dm_reread_part_table (disk); + #endif + if (disk->dev->type != PED_DEVICE_FILE) { ++ /* The ioctl() command BLKPG_ADD_PARTITION does not notify ++ * the devfs system; consequently, /proc/partitions will not ++ * be up to date, and the proper links in /dev are not ++ * created. Therefore, if using DevFS, we must get the kernel ++ * to re-read and grok the partition table. ++ */ ++ /* Work around kernel dasd problem so we really do BLKRRPART */ ++ int ok = 1; ++ if (disk->dev->type != PED_DEVICE_DASD && _have_blkpg ()) { ++ if (!_disk_sync_part_table (disk)) ++ ok = 0; ++ } + +- /* We now require BLKPG support. If this assertion fails, +- please write to the mailing list describing your system. +- Assuming it's never triggered, ... +- FIXME: remove this assertion in 2012. */ +- assert (_have_blkpg ()); +- +- if (!_disk_sync_part_table (disk)) +- return 0; ++ return ok; + } + + return 1;