Gitweb:
http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 3a8e770b5466fa477a98c6e010babe96fbab0bd1
Parent: 337eecbdc58818617ae7124d1eeb0aeb002caf59
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Mon Jan 24 12:47:23 2011 -0600
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Tue Jan 25 09:38:30 2011 -0600
fence_scsi: always do sg_turs for dm-mp devices
This patch fixes a with the original patch posted last week. Before
attempting to register with a device, we should call sg_turs on the
device. If that device is a dm-multipath device, we should call sg_turs
on all the paths. This can be done by simply moving the call to do_reset
to do_register and do_register_ignore.
Also, the patch adds a call to do_reset before doing a "status" action.
If a node has been fenced and then proceeds to check its status, it will
be in "unit attention" state.
Resolves: rhbz#640343
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
fence/agents/scsi/fence_scsi.pl | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 10dc26a..5156881 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -46,7 +46,6 @@ sub do_action_on ($@)
log_error ("device $dev does not exist") if (! -e $dev);
log_error ("device $dev is not a block device") if (! -b $dev);
- do_reset ($dev);
do_register_ignore ($node_key, $dev);
if (!get_reservation_key ($dev)) {
@@ -94,6 +93,8 @@ sub do_action_status ($@)
log_error ("device $dev does not exist") if (! -e $dev);
log_error ("device $dev is not a block device") if (! -b $dev);
+ do_reset ($dev);
+
my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
if (scalar (@keys) != 0) {
@@ -129,6 +130,8 @@ sub do_register ($$$)
my $cmd;
my $out;
+ do_reset ($dev);
+
$cmd = "sg_persist -n -o -G -K $host_key -S $node_key -d $dev";
$cmd .= " -Z" if (defined $opt_a);
$out = qx { $cmd };
@@ -158,11 +161,13 @@ sub do_register_ignore ($$)
my $cmd;
my $out;
+ do_reset ($dev);
+
$cmd = "sg_persist -n -o -I -S $node_key -d $dev";
$cmd .= " -Z" if (defined $opt_a);
$out = qx { $cmd };
- die "[error]: $self\n" if ($?>>8);
+ die "[error]: $self ($dev)\n" if ($?>>8);
return;
}