Bug 63765
Summary: | sg driver problem | ||
---|---|---|---|
Product: | [Retired] Red Hat Public Beta | Reporter: | Joshua Giles <joshua_giles> |
Component: | kernel | Assignee: | Larry Woodman <lwoodman> |
Status: | CLOSED WONTFIX | QA Contact: | Brian Brock <bbrock> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | pensacola | CC: | john_hull |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2003-01-24 23:08:12 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Joshua Giles
2002-04-18 15:32:17 UTC
The attached URL that describes the probelm is not valid, please update with a new/valid URL. Larry Woodman As per note [1] on http://www.torque.net/sg/p/sg_v3_ho/x255.html: "Some lower level drivers (e.g. ide-scsi) clear this status field even when a CHECK_CONDITION or COMMAND_TERMINATED status has occurred. However they do set DRIVER_SENSE in driver_status field. Also a (sb_len_wr > 0) indicates there is a sense buffer." From Issue Tracker 7723 (now closed): This issue was discussed a few months ago on the linix-scsi mailing list: http://marc.theaimsgroup.com/?l=linux-scsi&m=102616141801736&w=2 In summary, the current behavior of ide-scsi (and the SCSI midlayer) is plausibly correct. Therefore, you should write your program to check for non-zero sense data, rather than rely on the SCSI status to indicate success or failure. The reason you can not rely on the SCSI status is because some SCSI adapters (e.g. ide-scsi) do not do autosense. This means that when a command fails, the adapter driver returns the failure status to the SCSI midlayer, and the midlayer must issue a Request Sense command to get the sense data. The Request Sense command succeeds, and so the midlayer ends up returning good status, with the sense data for the failed command. That's ugly, but it is justifiable, considering the way the SCSI protocol works. This problem is solved for ide-scsi in 2.5, because autosense has been added to ide-scsi. This means that when a command fails, the ide-scsi driver will do the Request Sense command on its own, and then return the sense data to the midlayer at the same time as the status for the failed command. |