* [Cluster-devel] [PATCH] fence_scsi: identify dm-multipath devices correctly
@ 2011-01-18 20:42 Ryan O'Hara
2011-01-19 1:25 ` Lon Hohberger
0 siblings, 1 reply; 2+ messages in thread
From: Ryan O'Hara @ 2011-01-18 20:42 UTC (permalink / raw)
To: cluster-devel.redhat.com
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@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 9ee8917..8ddde4e 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) {
--
1.7.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH] fence_scsi: identify dm-multipath devices correctly
2011-01-18 20:42 [Cluster-devel] [PATCH] fence_scsi: identify dm-multipath devices correctly Ryan O'Hara
@ 2011-01-19 1:25 ` Lon Hohberger
0 siblings, 0 replies; 2+ messages in thread
From: Lon Hohberger @ 2011-01-19 1:25 UTC (permalink / raw)
To: cluster-devel.redhat.com
On Tue, 2011-01-18 at 14:42 -0600, Ryan O'Hara wrote:
> 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@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 9ee8917..8ddde4e 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) {
ACK; this is fine
-- Lon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-19 1:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-18 20:42 [Cluster-devel] [PATCH] fence_scsi: identify dm-multipath devices correctly Ryan O'Hara
2011-01-19 1:25 ` Lon Hohberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).