Bug 1400491 - rescan-scsi-bus.sh removes devices after their revision changes
Summary: rescan-scsi-bus.sh removes devices after their revision changes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sg3_utils
Version: 7.3
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Gris Ge
QA Contact: zguo
URL:
Whiteboard:
Depends On:
Blocks: 1420851 1473612 1546181
TreeView+ depends on / blocked
 
Reported: 2016-12-01 11:27 UTC by Andreas Bleischwitz
Modified: 2021-09-03 14:09 UTC (History)
7 users (show)

Fixed In Version: sg3_utils-1.37-14.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 10:54:34 UTC
Target Upstream Version:


Attachments (Terms of Use)
scsi_debug code with rev change patch (30.25 KB, application/x-gzip)
2018-04-17 13:08 UTC, Gris Ge
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3181 0 None None None 2018-10-30 10:54:45 UTC

Description Andreas Bleischwitz 2016-12-01 11:27:30 UTC
Description of problem:
"rescan-scsi-bus.sh -r" currently removes and re-adds scsi-disk after their SCSI-Revision changed which could render a system unusable.

Version-Release number of selected component (if applicable):
sg3_utils-1.37-5.el7.x86_64

How reproducible:
Always after SCSI-revision change

Steps to Reproduce:
1. Create virtual machine on a host running qemu-2.4 or lower
2. live migrate that machine to a host running qemu-2.5+
3. issue a "rescan-scsi-bus.sh -r" on the quest

Actual results:
System detects a SCSI-revision change and removes the old-disk and re-adds the disk with the updated revision - which renders the system unusable.

Expected results:
System detects SCSI-revision change and issues a "rescan" to reflect any updates or simply ignores the revision change.

Additional info:
The issue is caused by a revision change of a existing SCSI-disk. This also affects disks which may be presented by a storage-system which gets a firmware upgrade - yes this is possible doing online without interruption of the disk.

Comment 4 Andreas Bleischwitz 2017-02-10 09:48:25 UTC
In case that rescan-scsi-bus.sh with option "-r" can not be changed in the behavior, we should at least remark that this could be a very dangerous action as system-devices could be removed and render the system unusable.

This should be reflected in the output of "--help" and in the manpage at least.

Raised the priority for given reason.

Comment 6 Gris Ge 2017-03-07 14:30:43 UTC
Hi Andreas Bleischwitz,

Changing "-r" behaviour is too risky, I am intend to:

 1. Add new option like '--ignore-rev-change' to skip remove/readd on disks with
    rev change only.
 2. Mark '-r' option as 'DANGEROUS'.

How's that sounds to you?

Comment 7 Andreas Bleischwitz 2017-03-07 14:33:45 UTC
Hi Gris,

sounds reasonable. I'm fine with a opt-out for the "-r" parameter and that this will be marked as potentially dangerous.
That way we would not change current behaviour - which may be intentionally remove devices on revision-changes.
/Andreas

Comment 8 Gris Ge 2017-03-10 10:00:09 UTC
Patch send to upstream for review.

https://github.com/hreinecke/sg3_utils/pull/13

I didn't mark '-r' as dangerous as 'remove' seems already contain dangerous in it.

Comment 9 Gris Ge 2017-03-10 10:20:06 UTC
Hi Andreas Bleischwitz,

I have no idea how to do a live migrate VM.

Could try these rpms in your system for `sudo rescan-scsi-bus.sh -r --ignore-rev`
command:
    http://people.redhat.com/fge/BZ_1400491/

Thank you very much.

Comment 12 Tom Coughlan 2017-04-27 16:32:21 UTC
Not accepted upstream yet.

Comment 14 Red Hat Bugzilla Rules Engine 2017-11-03 13:46:56 UTC
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.

Comment 19 Gris Ge 2018-04-17 13:08:14 UTC
Created attachment 1423018 [details]
scsi_debug code with rev change patch

Reproduce steps:

 * Download attached tarball and extract it.
 * cd scsi_debug-el7-bz-1400491 && sudo make
 * sudo insmod scsi_debug.ko
 * To change revision: 
   echo -n '0001' | sudo tee /sys/module/scsi_debug/parameters/inq_rev
 * To check current revision:
   sg_inq /dev/sdb

Comment 22 Gris Ge 2018-06-12 12:32:10 UTC
`--ignore-rec` option has been added to `rescan-scsi-bus.sh` command.

Comment 27 errata-xmlrpc 2018-10-30 10:54:34 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://access.redhat.com/errata/RHBA-2018:3181


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