John Ferlan e7bde8d319 storage: Fix algorithm generating path names for devmapper
https://bugzilla.redhat.com/show_bug.cgi?id=1265694

Commit id '020135dc' didn't quite get the algorithm correct when a
device mapper source ended with a non numeric value (e.g. ends with
an alphabet value).

This patch modifies the 'part_separator' logic to add the "p" separator
to the attempted target path name only when specified as part_separator='yes'.

For a source name that already ends with a number, the logic doesn't change
as the part separator would need to be there.

For a source name that ends with something other than a number, this allows
the possibility that a "p" separator can be added. The default for one of
these source devices is to not add the separator.

The key for device mapper and the need for a partition separator "p" is
the presence of a number in the last character of the device name link
in /dev/mapper.  A name such as "/dev/mapper/mpatha1" would generate
a "/dev/mapper/mpatha1p1" partition, while "/dev/mapper/mpatha" would
generate partition "/dev/mapper/mpatha1". Similarly for a device
mapper entry not using friendly names or an alias, a device such as
"/dev/mapper/3600a0b80005b10ca00005ad656fd8d93" would generate a
paritition "/dev/mapper/3600a0b80005b10ca00005ad656fd8d93p1", while
a device such as "/dev/mapper/3600a0b80005b10ca00005e115729093f" would
generate a partition "/dev/mapper/3600a0b80005b10ca00005e115729093f1".
The long number is the WWID of the device. It's also possible to assign
an alias for a device mapper entry, that alias follows the same rules
with respect to ending with a number or not when adding a "p" to create
the target device path.
2016-05-11 09:23:31 -04:00
..
2014-12-02 07:30:10 +01:00
2015-08-25 07:21:33 -04:00
2016-04-26 09:20:12 +02:00
2015-03-23 09:01:30 +01:00
2015-03-23 09:01:30 +01:00
2014-03-03 17:41:26 +04:00
2013-12-02 10:21:26 +08:00
2014-12-02 07:30:10 +01:00
2014-12-02 07:30:10 +01:00
2009-07-16 15:06:42 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2016-05-01 09:50:21 +08:00
2015-10-20 17:30:34 +02:00
2016-03-29 13:45:33 +02:00
2013-09-12 17:18:32 +08:00
2014-12-02 07:30:10 +01:00