All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@ubuntu.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: [PATCH] Don't add 'p' delimiter when you shouldn't
Date: Sun, 08 Jan 2012 22:08:23 -0500	[thread overview]
Message-ID: <4F0A5A27.8090107@ubuntu.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 989 bytes --]

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) {


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2012-01-09  3:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09  3:08 Phillip Susi [this message]
2012-02-09 19:33 ` [PATCH] Don't add 'p' delimiter when you shouldn't Phillip Susi
2012-02-09 20:17 ` Christophe Varoqui
  -- strict thread matches above, loose matches on Subject: below --
2013-01-07 19:56 Phillip Susi
2013-01-08  7:04 ` Christophe Varoqui
2013-01-08 14:20   ` Phillip Susi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F0A5A27.8090107@ubuntu.com \
    --to=psusi@ubuntu.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.