Blame SOURCES/parted-3.1-libparted-don-t-canonicalize-dev-md-paths.patch

8dc857
From c17f0c2e68960969789427eca20ddab1b8e4fcc6 Mon Sep 17 00:00:00 2001
8dc857
From: "Brian C. Lane" <bcl@redhat.com>
8dc857
Date: Thu, 1 Nov 2012 16:22:42 -0700
8dc857
Subject: [PATCH] libparted: don't canonicalize /dev/md/ paths (#872361)
8dc857
8dc857
This is the same issue we have with /dev/mapper/ paths that was fixed in
8dc857
commit c1eb485b9fd8919e18f192d678bc52b0488e6ee0. When libparted
8dc857
is used to setup the device the symlink should be used to reference it,
8dc857
not the backing device name which could change.
8dc857
8dc857
* libparted/device.c (ped_device_get): Don't canonicalize names
8dc857
  that start with "/dev/md/".
8dc857
---
8dc857
 libparted/device.c | 7 +++++--
8dc857
 1 file changed, 5 insertions(+), 2 deletions(-)
8dc857
8dc857
diff --git a/libparted/device.c b/libparted/device.c
8dc857
index 738b320..cdcc117 100644
8dc857
--- a/libparted/device.c
8dc857
+++ b/libparted/device.c
8dc857
@@ -152,8 +152,11 @@ ped_device_get (const char* path)
8dc857
 	char*		normal_path = NULL;
8dc857
 
8dc857
 	PED_ASSERT (path != NULL);
8dc857
-	/* Don't canonicalize /dev/mapper paths, see tests/symlink.c */
8dc857
-	if (strncmp (path, "/dev/mapper/", 12))
8dc857
+	/* Don't canonicalize /dev/mapper or /dev/md/ paths, see
8dc857
+	   tests/symlink.c
8dc857
+	*/
8dc857
+	if (strncmp (path, "/dev/mapper/", 12) &&
8dc857
+	    strncmp (path, "/dev/md/", 8))
8dc857
 		normal_path = canonicalize_file_name (path);
8dc857
 	if (!normal_path)
8dc857
 		/* Well, maybe it is just that the file does not exist.
8dc857
-- 
8dc857
1.7.11.7
8dc857