parted/parted-dev-mapper-symlink-rh577824.patch

41 lines
1.3 KiB
Diff

From 70352b39e16f881b915b06440331acf47bcef984 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@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