RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1311138 - rescan-scsi-bus.sh removing and re-adding disks it probably shouldn't
Summary: rescan-scsi-bus.sh removing and re-adding disks it probably shouldn't
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sg3_utils
Version: 6.7
Hardware: All
OS: Linux
high
high
Target Milestone: beta
: ---
Assignee: David Sommerseth
QA Contact: Jan Kepler
URL:
Whiteboard:
: 1311557 (view as bug list)
Depends On:
Blocks: 1172231 1314887
TreeView+ depends on / blocked
 
Reported: 2016-02-23 13:25 UTC by Sirius Rayner-Karlsson
Modified: 2019-10-10 11:18 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1314887 (view as bug list)
Environment:
Last Closed: 2016-05-11 00:30:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch (604 bytes, patch)
2016-02-23 13:29 UTC, Sirius Rayner-Karlsson
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2184591 0 None None None 2016-03-04 12:58:32 UTC
Red Hat Product Errata RHBA-2016:0905 0 normal SHIPPED_LIVE sg3_utils bug fix update 2016-05-10 22:51:23 UTC

Description Sirius Rayner-Karlsson 2016-02-23 13:25:47 UTC
Description of problem:

With sg3_utils-1.28-8.el6 the rescan-scsi-bus.sh script could be run with the '-r' flag on systems without problems. Updating to sg3_utils-1.28-9.el6_7 this causes filesystems residing on the internal disk to go read-only.

Version-Release number of selected component (if applicable):

sg3_utils-1.28-9.el6_7

How reproducible:

Very, and it panicked my test VM twice, just running it.

Steps to Reproduce:
1. Install RHEL 6.7 and sg3_utils
2. Apply all errata
3. run "rescan-scsi-bus.sh -r"

Actual results:

Root filesystem goes read-only

Expected results:

System only removes and re-adds the LUNs that actually has changed.

Additional info:

Debugging this, I found that the fix from BZ#1291579 added double-quotes around two variables when comparing them. That creates a problem when the variable content have varying amount of leading or trailing whitespace.

The observation after putting a bit of debug in the script was the following:

~~~
"Host: scsi8 Channel: 00 Id: 01 Lun: 00
  Vendor:          Model: RHEL6x-2 SSD     Rev: F.5C
  Type:   Direct-Access                    ANSI SCSI revision: 05"
"Direct-Access                    "
"Direct-Access    "
~~~

Where the last two lines correspond to $TMPSTR and $TYPE. This meant the comparison failed and the script erroneously assumed the devices had changed, thus removing them and re-adding them.

Comment 1 Sirius Rayner-Karlsson 2016-02-23 13:29:36 UTC
Created attachment 1129761 [details]
proposed patch

Here is a proposed patch that simply strips leading and trailing whitespace from the variables and then use that in the comparison. I have tested it in my VM and it seems to work correctly. I have had additional confirmation from the reporter that it resolves the problem in their environment as well.

Comment 2 David Sommerseth 2016-03-03 19:26:39 UTC
*** Bug 1311557 has been marked as a duplicate of this bug. ***

Comment 16 David Sommerseth 2016-03-04 18:35:32 UTC
This issue has been fixed in sg3_utils-1.28-12.el6 (RHEL 6.8)

Comment 28 errata-xmlrpc 2016-05-11 00:30:06 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.

https://rhn.redhat.com/errata/RHBA-2016-0905.html


Note You need to log in before you can comment on or make changes to this bug.