When kpartx creates partition devices, it uses the mapname as the base
for the partition device names. However when choosing the delimiter,
it uses the device name passed in. So if kpartx is called on /dev/dm-X
it will always add a 'p', even if the mapname ends in a letter. This
patch fixes that by setting the delimiter based on the mapname.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
if (delim == NULL) {
delim = malloc(DELIM_SIZE);
memset(delim, 0, DELIM_SIZE);
- set_delimiter(device, delim);
+ set_delimiter(mapname, delim);
}
fd = open(device, O_RDONLY);