diff --git a/parted-dev-mapper-symlink-rh577824.patch b/parted-dev-mapper-symlink-rh577824.patch new file mode 100644 index 0000000..76f6381 --- /dev/null +++ b/parted-dev-mapper-symlink-rh577824.patch @@ -0,0 +1,40 @@ +From 70352b39e16f881b915b06440331acf47bcef984 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 6 Apr 2010 15:02:09 +0200 +Subject: [PATCH parted] libparted: Don't canonicalize /dev/mapper paths + +Besides fixing the issue displayed by libparted/tests/symlink.c, +this has the added advantage that the output of parted p on one of these +devices now says: +"Disk /dev/mapper/BigVol2-lv_iscsi_disk2: 34.4GB" + +Which is a lot more user friendly then the output before this patch: +"Disk /dev/dm-6: 34.4GB" + +* libparted/device.c: Don't canonicalize /dev/mapper paths +--- + libparted/device.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/libparted/device.c b/libparted/device.c +index 0f36a03..64da978 100644 +--- a/libparted/device.c ++++ b/libparted/device.c +@@ -139,10 +139,12 @@ PedDevice* + ped_device_get (const char* path) + { + PedDevice* walk; +- char* normal_path; ++ char* normal_path = NULL; + + PED_ASSERT (path != NULL, return NULL); +- normal_path = canonicalize_file_name (path); ++ /* Don't canonicalize /dev/mapper paths, see tests/symlink.c */ ++ if (strncmp (path, "/dev/mapper/", 12)) ++ normal_path = canonicalize_file_name (path); + if (!normal_path) + /* Well, maybe it is just that the file does not exist. + * Try it anyway. */ +-- +1.7.0.1 + diff --git a/parted.spec b/parted.spec index 7b2aec6..2298322 100644 --- a/parted.spec +++ b/parted.spec @@ -4,18 +4,35 @@ Summary: The GNU disk partition manipulation program Name: parted Version: 2.1 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv3+ Group: Applications/System URL: http://www.gnu.org/software/parted Source0: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz +# All these patches are in upstream git and all but +# Patch 7 are in the new parted-2.2 release + +# Use the physical sector size sysfs attribute rather then the +# minimum io size to get the physical sector size Patch1: parted-2.1-blkid_topology_get_physical_sector_size.patch +# Fix a few memleaks in GPT error handling paths Patch2: parted-2.1-mem-leak-fixes-rh556012.patch +# When a disk does not report its aligment preferences default to an alignment +# of 1 MiB Patch3: parted-2.1-default-alignment.patch +# Ensure that merely printing a GPT partition table does not modify the pMBR. +# Due to a bug in parted-2.1, "parted /dev/... print" would do just that. +# Not a problem for most, but if you have a hybrid, e.g., gptsync'd table Patch4: parted-2.1-gpt-clobber-pmbr-rh563211.patch +# Fix a NULL dereference in the dasd handling code, this stops parted from +# crashing on dasd disks with partitions which do not hold a recognizable fs Patch5: parted-2.1-dasd-NULL-dereference-rh563419.patch +# Copy over the needs_clobber flag in ped_disk_duplicate Patch6: parted-2.1-needs_clobber-rh566181.patch +# Don't cache the resolving of /dev/mapper/... symlinks, they may point +# to a different /dev/dm-# by the time we use the cached result. +Patch7: parted-dev-mapper-symlink-rh577824.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: e2fsprogs-devel @@ -61,6 +78,7 @@ Parted library, you need to install this package. %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 iconv -f ISO-8859-1 -t UTF8 AUTHORS > tmp; touch -r AUTHORS tmp; mv tmp AUTHORS @@ -136,6 +154,9 @@ fi %changelog +* Tue Apr 6 2010 Hans de Goede 2.1-6 +- Parted should not canonicalize symlinks under /dev/mapper (#577824) + * Thu Feb 18 2010 Hans de Goede 2.1-5 - Copy needs_clobber value in ped_disk_duplicate() (#561976)