|
|
4728c8 |
---
|
|
|
4728c8 |
libmultipath/devmapper.c | 12 ++++++++++--
|
|
|
4728c8 |
1 file changed, 10 insertions(+), 2 deletions(-)
|
|
|
4728c8 |
|
|
|
4728c8 |
Index: multipath-tools-130222/libmultipath/devmapper.c
|
|
|
4728c8 |
===================================================================
|
|
|
4728c8 |
--- multipath-tools-130222.orig/libmultipath/devmapper.c
|
|
|
4728c8 |
+++ multipath-tools-130222/libmultipath/devmapper.c
|
|
|
4728c8 |
@@ -1151,6 +1151,8 @@ dm_rename_partmaps (char * old, char * n
|
|
|
4728c8 |
unsigned long long size;
|
|
|
4728c8 |
char dev_t[32];
|
|
|
4728c8 |
int r = 1;
|
|
|
4728c8 |
+ int offset;
|
|
|
4728c8 |
+ char *delim;
|
|
|
4728c8 |
|
|
|
4728c8 |
if (!(dmt = dm_task_create(DM_DEVICE_LIST)))
|
|
|
4728c8 |
return 1;
|
|
|
4728c8 |
@@ -1171,6 +1173,11 @@ dm_rename_partmaps (char * old, char * n
|
|
|
4728c8 |
if (dm_dev_t(old, &dev_t[0], 32))
|
|
|
4728c8 |
goto out;
|
|
|
4728c8 |
|
|
|
4728c8 |
+ if (isdigit(new[strlen(new)-1]))
|
|
|
4728c8 |
+ delim = "p";
|
|
|
4728c8 |
+ else
|
|
|
4728c8 |
+ delim = "";
|
|
|
4728c8 |
+
|
|
|
4728c8 |
do {
|
|
|
4728c8 |
if (
|
|
|
4728c8 |
/*
|
|
|
4728c8 |
@@ -1198,8 +1205,9 @@ dm_rename_partmaps (char * old, char * n
|
|
|
4728c8 |
* then it's a kpartx generated partition.
|
|
|
4728c8 |
* Rename it.
|
|
|
4728c8 |
*/
|
|
|
4728c8 |
- snprintf(buff, PARAMS_SIZE, "%s%s",
|
|
|
4728c8 |
- new, names->name + strlen(old));
|
|
|
4728c8 |
+ for (offset = strlen(old); names->name[offset] && !(isdigit(names->name[offset])); offset++); /* do nothing */
|
|
|
4728c8 |
+ snprintf(buff, PARAMS_SIZE, "%s%s%s",
|
|
|
4728c8 |
+ new, delim, names->name + offset);
|
|
|
4728c8 |
dm_rename(names->name, buff);
|
|
|
4728c8 |
condlog(4, "partition map %s renamed",
|
|
|
4728c8 |
names->name);
|