doug-gilbert / sg3_utils

Author's own git mirror of his sg3_utils subversion repository. Note: default branch is now _main_. It includes tags from the various releases.
https://sg.danny.cz/sg/sg3_utils.html
Other
22 stars 22 forks source link

invalid VPD response; probably a STANDARD INQUIRY response #34

Open xosevp opened 1 year ago

xosevp commented 1 year ago
# /usr/local/sbin/rescan-scsi-bus.sh -V
20220930

# rpm -q sg3_utils
sg3_utils-1.46-5.fc38.x86_64

# /usr/local/sbin/rescan-scsi-bus.sh 
Scanning SCSI subsystem for new devices
Scanning host 0 for  SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
 Scanning for device 0 0 0 0 ... 
OLD:  Host: scsi0 Channel: 00 Id: 00 Lun: 00
      Vendor: ATA      Model: OCZ-AGILITY3     Rev: 2.50
      Type:   Direct-Access                    ANSI SCSI revision: 05
Scanning host 1 for  SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
Scanning host 2 for  SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
Scanning host 3 for  SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
Scanning host 4 for  SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
Scanning host 5 for  SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
egrep: warning: egrep is obsolescent; using grep -E
 Scanning for device 5 0 0 0 ...           
OLD:  Host: scsi5 Channel: 00 Id: 00 Lun: 00
      Vendor: hp       Model: DVD-RAM GH80N    Rev: RF03
      Type:   CD-ROM                           ANSI SCSI revision: 05
..............................Scanning host 6 for  SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
 Scanning for device 6 0 0 0 ... 
OLD:  Host: scsi6 Channel: 00 Id: 00 Lun: 00
      Vendor: ATA      Model: Samsung SSD 860  Rev: 4B6Q
      Type:   Direct-Access                    ANSI SCSI revision: 05
Scanning host 7 for  SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
 Scanning for device 7 0 0 0 ... 
OLD:  Host: scsi7 Channel: 00 Id: 00 Lun: 00
      Vendor: ATA      Model: WDC WD40EZRZ-00G Rev: 0A80
      Type:   Direct-Access                    ANSI SCSI revision: 05
Scanning host 8 for  SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
 Scanning for device 8 0 0 0 ... 
OLD:  Host: scsi8 Channel: 00 Id: 00 Lun: 00
      Vendor: WD       Model: My Book 25EE     Rev: 4009
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 8 0 0 1 ... 
OLD:  Host: scsi8 Channel: 00 Id: 00 Lun: 01
      Vendor: WD       Model: SES Device       Rev: 4009
      Type:   Enclosure                        ANSI SCSI revision: 06
Scanning host 9 for  SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
egrep: warning: egrep is obsolescent; using grep -E
 Scanning for device 9 0 0 0 ...           
OLD:  Host: scsi9 Channel: 00 Id: 00 Lun: 00
      Vendor: Multiple Model: Card  Reader     Rev: 1.00
      Type:   Direct-Access                    ANSI SCSI revision: -1
invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.invalid VPD response; probably a STANDARD INQUIRY response
.Scanning host 10 for  SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
 Scanning for device 10 0 0 0 ... 
OLD:  Host: scsi10 Channel: 00 Id: 00 Lun: 00
      Vendor: WD       Model: My Passport 070A Rev: 2018
      Type:   Direct-Access                    ANSI SCSI revision: 04
 Scanning for device 10 0 0 1 ... 092005375 ... 
OLD:  Host: scsi10 Channel: 00 Id: 00 Lun: 01
      Vendor: WD       Model: SES Device       Rev: 2018
      Type:   Enclosure                        ANSI SCSI revision: 04
0 new or changed device(s) found.          
0 remapped or resized device(s) found.
0 device(s) removed.                 

is it a bug? or a normal response?

Thank you.

doug-gilbert commented 1 year ago

It's a bug. Been doing work on sg_inq and sg_vpd since they overlap about 90% and had separate VPD page decoding which was a pain to maintain. So lots of changes hence the risk of regressions and you have reported one. Able to replicate here with a removable SD card reader. Will work on it today. Also sped up sg_inq which was repeating some operations (e.g. scanning the /dev directory) which obviously wasted time.

doug-gilbert commented 1 year ago

Just mirrored svn revision 1023 here. With a test set of two different USB card readers, I found one had a broken INQUIRY response, but both gave a good TEST UNIT READY responses. That was asc/ascq = 0x3A/0x0 which means MEDIUM NOT PRESENT. Once that sense is seen, it is pointless to retry for 30 seconds hoping that someone will insert a SD card. The reported failure was also on a (USB ?) "Card Reader" so I would be grateful it you would try this new revision and report back how it goes. sg_inq and sg_turs have also been changed but there is script code to pick up the version numbers of those utilities and be relatively well behaved if sg_inq (for example) is from an older version. On my test server, with 12 real SCSI devices and two USB card readers, rescan-scsi-bus.sh took about 0.8 seconds (using the revision just mirrored).