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

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