rpms/parted/devel parted-dev-mapper-symlink-rh577824.patch, NONE, 1.1 parted.spec, 1.166, 1.167

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


Author: jwrdegoede

Update of /cvs/pkgs/rpms/parted/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv20265

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.2-2
- 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/devel/parted.spec,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -p -r1.166 -r1.167
--- parted.spec	30 Mar 2010 12:56:19 -0000	1.166
+++ parted.spec	6 Apr 2010 15:16:50 -0000	1.167
@@ -4,12 +4,17 @@
 Summary: The GNU disk partition manipulation program
 Name:    parted
 Version: 2.2
-Release: 1%{?dist}
+Release: 2%{?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 patches are in upstream git
+
+# 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.
+Patch0: parted-dev-mapper-symlink-rh577824.patch
 
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: e2fsprogs-devel
@@ -49,6 +54,7 @@ Parted library, you need to install this
 
 %prep
 %setup -q
+%patch0 -p1
 iconv -f ISO-8859-1 -t UTF8 AUTHORS > tmp; touch -r AUTHORS tmp; mv tmp AUTHORS
 
 
@@ -124,6 +130,9 @@ fi
 
 
 %changelog
+* Tue Apr  6 2010 Hans de Goede <hdegoede at redhat.com> 2.2-2
+- Parted should not canonicalize symlinks under /dev/mapper (#577824)
+
 * Tue Mar 30 2010 Hans de Goede <hdegoede at redhat.com> 2.2-1
 - New upstream version 2.2 (#577478)
 - Drop all our patches (all upstreamed)



More information about the scm-commits mailing list