From patchwork Thu May 2 21:46:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 2514051 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by patchwork2.kernel.org (Postfix) with ESMTP id E1A84DF215 for ; Thu, 2 May 2013 21:52:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r42Lm40i021133; Thu, 2 May 2013 17:48:04 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r42Ll5Hk028978 for ; Thu, 2 May 2013 17:47:05 -0400 Received: from ether.msp.redhat.com (ether.msp.redhat.com [10.15.80.119]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r42Ll4pE019618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 May 2013 17:47:05 -0400 Received: from ether.msp.redhat.com (localhost.localdomain [127.0.0.1]) by ether.msp.redhat.com (8.14.1/8.14.1) with ESMTP id r42Ll30W009067; Thu, 2 May 2013 16:47:03 -0500 Received: (from bmarzins@localhost) by ether.msp.redhat.com (8.14.1/8.14.1/Submit) id r42Ll2ra009066; Thu, 2 May 2013 16:47:02 -0500 From: Benjamin Marzinski To: device-mapper development Date: Thu, 2 May 2013 16:46:37 -0500 Message-Id: <1367531197-8987-17-git-send-email-bmarzins@redhat.com> In-Reply-To: <1367531197-8987-1-git-send-email-bmarzins@redhat.com> References: <1367531197-8987-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: dm-devel@redhat.com Cc: Christophe Varoqui Subject: [dm-devel] [PATCH 16/16] Use mapname to choose kpartx delimiter X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com 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 --- kpartx/kpartx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c index 30b3bd9..98d88c0 100644 --- a/kpartx/kpartx.c +++ b/kpartx/kpartx.c @@ -348,7 +348,7 @@ main(int argc, char **argv){ 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);