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

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