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 818638 - SG_IO sets host_status=0x10 for some sense values
Summary: SG_IO sets host_status=0x10 for some sense values
Keywords:
Status: CLOSED DUPLICATE of bug 787282
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Red Hat Kernel Manager
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-03 15:32 UTC by Paolo Bonzini
Modified: 2012-05-04 10:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-04 10:37:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Paolo Bonzini 2012-05-03 15:32:37 UTC
Description of problem:
scsi_check_sense has this code:

        case ILLEGAL_REQUEST:
                if (sshdr.asc == 0x20 || /* Invalid command operation code */
                    sshdr.asc == 0x21 || /* Logical block address out of range */
                    sshdr.asc == 0x24 || /* Invalid field in cdb */
                    sshdr.asc == 0x26) { /* Parameter value invalid */
                        return TARGET_ERROR;
                }
                return SUCCESS;

which then triggers this bit in scsi_decide_disposition:

                        /*
                         * Need to modify host byte to signal a
                         * permanent target failure
                         */
                        set_host_byte(scmd, DID_TARGET_FAILURE);
                        rtn = SUCCESS;

Recent kernels undo this change to the host byte somewhere along the way back to userspace, while RHEL6 leaves this unmodified.  This causes the host_byte to be set erroneously when executing a command with this sense:

$ strace sg_raw -e ioctl -v /dev/sda  12 1 1 0 0 0
ioctl(3, SG_IO, {'S', SG_DXFER_NONE, cmd[6]=[12, 01, 01, 00, 00, 00], mx_sb_len=32, iovec_count=0, dxfer_len=0, timeout=20000, flags=0, status=02, masked_status=01, sb[18]=[70, 00, 05, 00, 00, 00, 00, 0a, 00, 00, 00, 00, 24, 00, 00, 00, 00, 00], host_status=0x10, driver_status=0x8, resid=0, duration=0, info=0x1}) = 0

Then sg_raw emits

SCSI Status: Check Condition 
Sense Information:
sense buffer empty

Version-Release number of selected component (if applicable):
2.6.32-251.el6

How reproducible:
100%

Steps to Reproduce:
1. see above
  
Actual results:
"sense buffer empty"

Expected results:
Sense Information:
 Fixed format, current;  Sense key: Illegal Request
 Additional sense: Invalid field in cdb
 Raw sense data (in hex):
        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00    
        00 00                                               

or similar

Additional info:
This is shown by the scsi-testsuite tests at git://risingtidesystems.com/scsi-testsuite.git. Recent kernels give host_status=0.

Comment 1 Paolo Bonzini 2012-05-03 15:38:43 UTC
Expected results obtained with 3.3.0-8.fc17 kernel and RHEL6 userspace.

Comment 3 Paolo Bonzini 2012-05-04 10:37:07 UTC

*** This bug has been marked as a duplicate of bug 787282 ***


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