* [Cluster-devel] [PATCH] fence_scsi: always do sg_turs before registration
@ 2011-01-24 18:57 Ryan O'Hara
2011-01-24 20:51 ` Lon Hohberger
0 siblings, 1 reply; 3+ messages in thread
From: Ryan O'Hara @ 2011-01-24 18:57 UTC (permalink / raw)
To: cluster-devel.redhat.com
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>
---
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;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Cluster-devel] [PATCH] fence_scsi: always do sg_turs before registration
2011-01-24 18:57 [Cluster-devel] [PATCH] fence_scsi: always do sg_turs before registration Ryan O'Hara
@ 2011-01-24 20:51 ` Lon Hohberger
2011-01-24 20:57 ` Ryan O'Hara
0 siblings, 1 reply; 3+ messages in thread
From: Lon Hohberger @ 2011-01-24 20:51 UTC (permalink / raw)
To: cluster-devel.redhat.com
On Mon, 2011-01-24 at 12:57 -0600, Ryan O'Hara wrote:
> 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
Was reusing the same patch synopsis intentional here? It doesn't look
like a replacement of the patch; it looks like an additional patch.
-- Lon
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] [PATCH] fence_scsi: always do sg_turs before registration
2011-01-24 20:51 ` Lon Hohberger
@ 2011-01-24 20:57 ` Ryan O'Hara
0 siblings, 0 replies; 3+ messages in thread
From: Ryan O'Hara @ 2011-01-24 20:57 UTC (permalink / raw)
To: cluster-devel.redhat.com
On Mon, Jan 24, 2011 at 03:51:47PM -0500, Lon Hohberger wrote:
> On Mon, 2011-01-24 at 12:57 -0600, Ryan O'Hara wrote:
> > 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
>
> Was reusing the same patch synopsis intentional here? It doesn't look
> like a replacement of the patch; it looks like an additional patch.
>
> -- Lon
Not intentional, no. Its the same bug, and the 2nd patch is just a
tweak to the first patch so that is properly resets all paths for
dm-mp devices.
Sorry for any confusion.
Ryan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-24 20:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-24 18:57 [Cluster-devel] [PATCH] fence_scsi: always do sg_turs before registration Ryan O'Hara
2011-01-24 20:51 ` Lon Hohberger
2011-01-24 20:57 ` Ryan O'Hara
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).