fence-agents: master - fence_scsi: identify dm-multipath devices correctly

rohara rohara at fedoraproject.org
Mon Feb 7 18:44:12 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=e4dbdbf552a70c45957f4da5f6dc578f3e163bc9
Commit:        e4dbdbf552a70c45957f4da5f6dc578f3e163bc9
Parent:        9316eeaac07eddd979819803d0e93a5646cb70c5
Author:        Ryan O'Hara <rohara at redhat.com>
AuthorDate:    Tue Jan 18 14:21:02 2011 -0600
Committer:     Ryan O'Hara <rohara at redhat.com>
CommitterDate: Mon Feb 7 12:40:52 2011 -0600

fence_scsi: identify dm-multipath devices correctly

Previously, fence_scsi would only identify /dev/dm* devices as being
multipath devices. This prevented the use of "friendly" dm-multipath
names (eg. /dev/mapper/mpath1). Since fence_scsi can now be passed
devices to operate on, it should be able to handle "friendly" names,
too. This patch fixes the problem by getting the absolute path of the
device at registration time.

Resolves: rhbz#644389

Signed-off-by: Ryan O'Hara <rohara at redhat.com>
Reviewed-by: Lon Hohberger <lhh at redhat.com>
---
 fence/agents/scsi/fence_scsi.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 992a3eb..620af3f 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -1,5 +1,6 @@
 #!/usr/bin/perl
 
+use Cwd 'realpath';
 use File::Basename;
 use Getopt::Std;
 use POSIX;
@@ -112,6 +113,8 @@ sub do_register ($$$)
     my $self = (caller(0))[3];
     my ($host_key, $node_key, $dev) = @_;
 
+    $dev = realpath ($dev);
+
     if (substr ($dev, 5) =~ /^dm/) {
 	my @slaves = get_mpath_slaves ($dev);
 	foreach (@slaves) {
@@ -139,6 +142,8 @@ sub do_register_ignore ($$)
     my $self = (caller(0))[3];
     my ($node_key, $dev) = @_;
 
+    $dev = realpath ($dev);
+
     if (substr ($dev, 5) =~ /^dm/) {
 	my @slaves = get_mpath_slaves ($dev);
 	foreach (@slaves) {


More information about the cluster-commits mailing list