From patchwork Thu Jan 17 14:59:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 1996921 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by patchwork2.kernel.org (Postfix) with ESMTP id 9DDAFDF2E1 for ; Thu, 17 Jan 2013 15:03:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0HF0dpx029535; Thu, 17 Jan 2013 10:00:39 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0HExbUX003608 for ; Thu, 17 Jan 2013 09:59:37 -0500 Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.21]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0HExb56018919 for ; Thu, 17 Jan 2013 09:59:37 -0500 Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0HExa8E022998 for ; Thu, 17 Jan 2013 09:59:36 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id B5D1FA50F4; Thu, 17 Jan 2013 15:59:35 +0100 (CET) From: Hannes Reinecke To: Christophe Varoqui Date: Thu, 17 Jan 2013 15:59:25 +0100 Message-Id: <1358434773-2002-4-git-send-email-hare@suse.de> In-Reply-To: <1358434773-2002-1-git-send-email-hare@suse.de> References: <1358434773-2002-1-git-send-email-hare@suse.de> X-RedHat-Spam-Score: -6.901 (BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.21 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com Subject: [dm-devel] [PATCH 03/11] kpartx_id: Generate persistent symlinks for 'wwn' 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 Newer udev versions generate /dev/disk/by-id/wwn-* symlinks. We should be adjusting those for multipathing, too. Signed-off-by: Hannes Reinecke --- kpartx/kpartx.rules | 4 ++++ kpartx/kpartx_id | 2 ++ 2 files changed, 6 insertions(+) diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules index 8640094..b96ec89 100644 --- a/kpartx/kpartx.rules +++ b/kpartx/kpartx.rules @@ -20,12 +20,16 @@ ENV{DM_UUID}=="mpath-*", \ SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}" ENV{DM_MPATH}=="?*", ENV{DM_PART}!="?*", \ SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_MPATH}" +ENV{DM_WWN}=="?*", ENV{DM_PART}!="?*", \ + SYMLINK+="disk/by-id/wwn-$env{DM_WWN}" # Create persistent links for partitions ENV{DM_PART}=="?*", \ SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}-part$env{DM_PART}" ENV{DM_MPATH}=="?*", ENV{DM_PART}=="?*", \ SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_MPATH}-part$env{DM_PART}" +ENV{DM_WWN}=="?*", ENV{DM_PART}=="?*", \ + SYMLINK+="disk/by-id/wwn-$env{DM_WWN}-part$env{DM_PART}" # Create dm tables for partitions ENV{DM_STATE}!="SUSPENDED", ENV{DM_UUID}=="mpath-*", \ diff --git a/kpartx/kpartx_id b/kpartx/kpartx_id index afb589c..47fab1a 100644 --- a/kpartx/kpartx_id +++ b/kpartx/kpartx_id @@ -69,6 +69,7 @@ elif [ "$dmtbl" = "mpath" ] ; then if [ -n "$DM_NAME" -a "$DM_NAME" != "$dmuuid" ] ; then echo "DM_MPATH=$dmuuid" fi + dmname="$dmuuid" # We need the dependencies of the table to figure out the type dmdeps=$($DMSETUP deps -u $UUID) elif [ "$dmtbl" = "dmraid" ] ; then @@ -92,6 +93,7 @@ if [ -n "$dmdeps" ] ; then ;; *) echo "DM_TYPE=scsi" + echo "DM_WWN=0x${dmname#?}" ;; esac else