From 7c73c61a4cae131142db4c6a13ca1482b3a9e134 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 1 Nov 2012 15:29:46 -0700 Subject: [PATCH] - don't canonicalize /dev/md/ paths (#872361) --- ...rted-don-t-canonicalize-dev-md-paths.patch | 37 +++++++++++++++++++ parted.spec | 6 ++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 parted-3.1-libparted-don-t-canonicalize-dev-md-paths.patch diff --git a/parted-3.1-libparted-don-t-canonicalize-dev-md-paths.patch b/parted-3.1-libparted-don-t-canonicalize-dev-md-paths.patch new file mode 100644 index 0000000..2390881 --- /dev/null +++ b/parted-3.1-libparted-don-t-canonicalize-dev-md-paths.patch @@ -0,0 +1,37 @@ +From c17f0c2e68960969789427eca20ddab1b8e4fcc6 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Thu, 1 Nov 2012 16:22:42 -0700 +Subject: [PATCH] libparted: don't canonicalize /dev/md/ paths (#872361) + +This is the same issue we have with /dev/mapper/ paths that was fixed in +commit c1eb485b9fd8919e18f192d678bc52b0488e6ee0. When libparted +is used to setup the device the symlink should be used to reference it, +not the backing device name which could change. + +* libparted/device.c (ped_device_get): Don't canonicalize names + that start with "/dev/md/". +--- + libparted/device.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/libparted/device.c b/libparted/device.c +index 738b320..cdcc117 100644 +--- a/libparted/device.c ++++ b/libparted/device.c +@@ -152,8 +152,11 @@ ped_device_get (const char* path) + char* normal_path = NULL; + + PED_ASSERT (path != NULL); +- /* Don't canonicalize /dev/mapper paths, see tests/symlink.c */ +- if (strncmp (path, "/dev/mapper/", 12)) ++ /* Don't canonicalize /dev/mapper or /dev/md/ paths, see ++ tests/symlink.c ++ */ ++ if (strncmp (path, "/dev/mapper/", 12) && ++ strncmp (path, "/dev/md/", 8)) + normal_path = canonicalize_file_name (path); + if (!normal_path) + /* Well, maybe it is just that the file does not exist. +-- +1.7.11.7 + diff --git a/parted.spec b/parted.spec index ab4cc49..2370fbc 100644 --- a/parted.spec +++ b/parted.spec @@ -4,7 +4,7 @@ Summary: The GNU disk partition manipulation program Name: parted Version: 3.1 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv3+ Group: Applications/System URL: http://www.gnu.org/software/parted @@ -26,6 +26,7 @@ Patch9: parted-3.1-libparted-reallocate-buf-after-_disk_analyse_block_s.patch Patch10: parted-3.1-tests-cleanup-losetup-usage.patch Patch11: parted-3.1-libparted-add-support-for-implicit-FBA-DASD-partitions.patch Patch12: parted-3.1-libparted-add-support-for-EAV-DASD-partitions.patch +Patch13: parted-3.1-libparted-don-t-canonicalize-dev-md-paths.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: e2fsprogs-devel @@ -161,6 +162,9 @@ fi %changelog +* Thu Nov 01 2012 Brian C. Lane 3.1-9 +- don't canonicalize /dev/md/ paths (#872361) + * Tue Oct 16 2012 Brian C. Lane 3.1-8 - change partition UUID to use partX-UUID (#858704) - fixup losetup usage in tests