Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 809481

Summary: fence_scsi_test will reset error counter after creating reservation
Product: Red Hat Enterprise Linux 5 Reporter: Ryan O'Hara <rohara>
Component: cmanAssignee: Ryan O'Hara <rohara>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8CC: cluster-maint, djansa, edamato, mjuricek
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cman-2.0.115-98.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-08 03:37:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Increment error count when reservation fails. none

Description Ryan O'Hara 2012-04-03 13:31:24 UTC
If fence_scsi_test attempts to create a reservation and fails, the error counter is set to zero. This is clearly a bug.

The easiest was to see this bug is to use fence_scsi_test on a device that clearly does no support SCSI-PR. Use the "on" action, any key, and be sure to use the verbose flag:

# fence_scsi_test -o on -k 123 -d /dev/sda -v
  main::do_key_write (key=123)
  main::get_devices
  main::print_devices
    /dev/sda
  main::get_devices_name (dev=/dev/sda)
    name=/dev/sda
  main::get_devices_path (dev=/dev/sda)
    path=[ /dev/sda ]
  main::do_action_on (dev=/dev/sda node_key=123)
  main::do_reset (dev=/dev/sda)
    cmd=sg_turs /dev/sda
    err=0
  main::do_register_ignore (dev=/dev/sda sark=123)
    cmd=sg_persist -n -o -I -S 123 -d /dev/sda
    err=9
  main::get_keys_reserve (dev=/dev/sda)
    cmd=sg_persist -n -i -r -d /dev/sda
    err=9
    keys=[  ]
  main::do_reserve (dev=/dev/sda rk=123)
    cmd=sg_persist -n -o -R -T 5 -K 123 -d /dev/sda
    err=9
  main::do_verify_on (dev=/dev/sda node_key=123)
  main::get_keys_register (dev=/dev/sda)
    cmd=sg_persist -n -i -k -d /dev/sda
    err=9
    keys=[  ]
  main::get_keys_reserve (dev=/dev/sda)
    cmd=sg_persist -n -i -r -d /dev/sda
    err=9
    keys=[  ]
  main::print_results (dev=/dev/sda)
    results=[ action=0 verify=2 ]

We can see that do_register_ignore and do_reserve both failed with err=9. This should be reflected in the results printed at the end of the script. In this case, we see the results are "[ action=0 verify=2 ]". This means there were no errors during registration/reservation creation. We should see "[ action=2 verify=2 ]".

Comment 1 Ryan O'Hara 2012-04-03 14:24:00 UTC
Created attachment 574879 [details]
Increment error count when reservation fails.

Don't reset the error count to zero if do_reserve fails. Instead, increment the error count. This fix will correctly report errors during the "action" portion of the test.

Comment 2 RHEL Program Management 2012-04-03 14:37:02 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 3 Ryan O'Hara 2012-04-03 14:42:17 UTC
Here is the same test with the patch:

# fence_scsi_test.pl -o on -k 123 -d /dev/sda -v
  main::do_key_write (key=123)
  main::get_devices
  main::print_devices
    /dev/sda
  main::get_devices_name (dev=/dev/sda)
    name=/dev/sda
  main::get_devices_path (dev=/dev/sda)
    path=[ /dev/sda ]
  main::get_keys_register (dev=/dev/sda)
    cmd=sg_persist -n -i -k -d /dev/sda
    err=9
    keys=[  ]
  main::do_action_on (dev=/dev/sda node_key=123)
  main::do_reset (dev=/dev/sda)
    cmd=sg_turs /dev/sda
    err=0
  main::do_register_ignore (dev=/dev/sda sark=123)
    cmd=sg_persist -n -o -I -S 123 -d /dev/sda
    err=9
  main::get_keys_reserve (dev=/dev/sda)
    cmd=sg_persist -n -i -r -d /dev/sda
    err=9
    keys=[  ]
  main::do_reserve (dev=/dev/sda rk=123)
    cmd=sg_persist -n -o -R -T 5 -K 123 -d /dev/sda
    err=9
  main::do_verify_on (dev=/dev/sda node_key=123)
  main::get_keys_register (dev=/dev/sda)
    cmd=sg_persist -n -i -k -d /dev/sda
    err=9
    keys=[  ]
  main::get_keys_reserve (dev=/dev/sda)
    cmd=sg_persist -n -i -r -d /dev/sda
    err=9
    keys=[  ]
  main::print_results (dev=/dev/sda)
    results=[ action=2 verify=2 ]

This test attempts to create a registration and reservation on /dev/sda, which does not support SCSI-PR. Both do_register_ignore and do_reserve fail as expected. Note that the results are now correct.

Comment 7 errata-xmlrpc 2013-01-08 03:37:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0076.html