Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commit... Commit: 522fef7acb26c7cdc46f5b0da8b20c1900c692b7 Parent: da047800ec78e8015fb6c82af260f2325b8e27ac Author: Ryan O'Hara rohara@redhat.com AuthorDate: Mon Jan 24 12:47:23 2011 -0600 Committer: Ryan O'Hara rohara@redhat.com CommitterDate: Mon Feb 7 12:42:27 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@redhat.com Reviewed-by: Lon Hohberger lhh@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 03c692c..7fcb685 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; }
cluster-commits@lists.fedorahosted.org