[PATCH] Fix partition names on multipath devices

Guido Guenther agx at sigxcpu.org
Fri Jun 6 13:58:06 UTC 2008


---
 libparted/arch/linux.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 4c9a2d3..3c07d51 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2014,6 +2014,7 @@ _device_get_part_path (PedDevice* dev, int num)
         int             path_len =3D strlen (dev->path);
         int             result_len =3D path_len + 16;
         char*           result;
+        LinuxSpecific*  arch_specific =3D LINUX_SPECIFIC (dev);
=20
         result =3D (char*) ped_malloc (result_len);
         if (!result)
@@ -2026,6 +2027,13 @@ _device_get_part_path (PedDevice* dev, int num)
                 /* replace /disc with /path%d */
                 strcpy (result, dev->path);
                 snprintf (result + path_len - 5, 16, "/part%d", num);
+#ifdef ENABLE_DEVICE_MAPPER
+        } else if (dev->type =3D=3D PED_DEVICE_DM && arch_specific->dmty=
pe &&
+                   strcmp(arch_specific->dmtype, "multipath") =3D=3D 0) =
{
+                /* This is what multipath-tools upstream and Debian uses=
, it's
+                 * a pure userpace (udev) decision! */
+                snprintf (result, result_len, "%s-part%d", dev->path, nu=
m);
+#endif
         } else if (dev->type =3D=3D PED_DEVICE_DAC960
                         || dev->type =3D=3D PED_DEVICE_CPQARRAY
                         || dev->type =3D=3D PED_DEVICE_ATARAID
--=20
1.5.5.3






More information about the Parted-maintainers mailing list