rpms/parted/F-13 parted-dev-mapper-symlink-rh577824.patch, NONE, 1.1 parted.spec, 1.165, 1.166

Hans de Goede jwrdegoede at fedoraproject.org
Tue Apr 6 15:16:54 UTC 2010


Author: jwrdegoede

Update of /cvs/pkgs/rpms/parted/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv20316

Modified Files:
	parted.spec 
Added Files:
	parted-dev-mapper-symlink-rh577824.patch 
Log Message:
* Tue Apr  6 2010 Hans de Goede <hdegoede at redhat.com> 2.1-6
- Parted should not canonicalize symlinks under /dev/mapper (#577824)


parted-dev-mapper-symlink-rh577824.patch:
 device.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- NEW FILE parted-dev-mapper-symlink-rh577824.patch ---
>From 70352b39e16f881b915b06440331acf47bcef984 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede at redhat.com>
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



Index: parted.spec
===================================================================
RCS file: /cvs/pkgs/rpms/parted/F-13/parted.spec,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -p -r1.165 -r1.166
--- parted.spec	18 Feb 2010 14:48:05 -0000	1.165
+++ parted.spec	6 Apr 2010 15:16:53 -0000	1.166
@@ -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
 %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 <hdegoede at redhat.com> 2.1-6
+- Parted should not canonicalize symlinks under /dev/mapper (#577824)
+
 * Thu Feb 18 2010 Hans de Goede <hdegoede at redhat.com> 2.1-5
 - Copy needs_clobber value in ped_disk_duplicate() (#561976)
 



More information about the scm-commits mailing list