[dm-devel] [PATCH] Don't add 'p' delimiter when you shouldn't
Phillip Susi
psusi at ubuntu.com
Mon Jan 9 03:08:23 UTC 2012
The 'p' delimiter is supposed to be added when the base disk name
ends in a digit. This decision was based on the name given on the
command line, not the canonical device name, so giving /dev/dm-0
instead of /dev/mapper/foo triggered the digit test and added the
'p'. Changed test to use the canonical name rather than the given
name.
Index: b/kpartx/kpartx.c
===================================================================
--- a/kpartx/kpartx.c
+++ b/kpartx/kpartx.c
@@ -310,12 +310,6 @@
device = loopdev;
}
- if (delim == NULL) {
- delim = malloc(DELIM_SIZE);
- memset(delim, 0, DELIM_SIZE);
- set_delimiter(device, delim);
- }
-
off = find_devname_offset(device);
if (!loopdev) {
@@ -331,6 +325,12 @@
if (!mapname)
mapname = device + off;
+ if (delim == NULL) {
+ delim = malloc(DELIM_SIZE);
+ memset(delim, 0, DELIM_SIZE);
+ set_delimiter(mapname, delim);
+ }
+
fd = open(device, O_RDONLY);
if (fd == -1) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20120108/00ec8db5/attachment.sig>
More information about the dm-devel
mailing list