fence_scsi: always do sg_turs before registration
PATCH 1/1 fence_scsi: always do sg_turs before registration
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
--- fence/agents/scsi/fence_scsi.pl | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
fence/agents/scsi/fence_scsi.pl +7 -2
@@ -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; }
Signature · 1 line
1.7.3.4
PATCH 1/1 fence_scsi: always do sg_turs before registration
Quoted 11 lines · Ryan O'Hara
This patch fixes a with the original patch posted last week. Before attempting to register with a device, we should call
sg_turson the device. If that device is a dm-multipath device, we should callsg_turson all the paths. This can be done by simply moving the call todo_resettodo_registeranddo_register_ignore.Also, the patch adds a call to
do_resetbefore 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
PATCH 1/1 fence_scsi: always do sg_turs before registration
Quoted 11 lines · Lon Hohberger
Quoted 10 lines · Ryan O'Hara
This patch fixes a with the original patch posted last week. Before attempting to register with a device, we should call
sg_turson the device. If that device is a dm-multipath device, we should callsg_turson all the paths. This can be done by simply moving the call todo_resettodo_registeranddo_register_ignore.Also, the patch adds a call to
do_resetbefore doing a "status" action. If a node has been fenced and then proceeds to check its status, it will be in "unit attention" state.
Quoted 6 lines
Quoted 1 line
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