diff options
author | ken <ken@FreeBSD.org> | 2012-06-22 18:57:06 +0000 |
---|---|---|
committer | ken <ken@FreeBSD.org> | 2012-06-22 18:57:06 +0000 |
commit | e2f0baed00ce9ed5f3f156ef5642c62c69ec8a45 (patch) | |
tree | d3b9496b47aa9edb049facfa7a63a03202522d56 /sys/cam | |
parent | a7497af6fda336f619e890435acf2c3b7788731b (diff) | |
download | FreeBSD-src-e2f0baed00ce9ed5f3f156ef5642c62c69ec8a45.zip FreeBSD-src-e2f0baed00ce9ed5f3f156ef5642c62c69ec8a45.tar.gz |
Change 'camcontrol defects' to first probe a drive to find out how much
defect information it has before grabbing the full defect list.
This works around a bug with some Hitachi drives that generate data overrun
errors when they are asked for more defect data than they have.
The change is done in a spec-compliant way, so it should have no negative
impact on drives that don't have this issue.
This is based on work originally done at Sandvine.
scsi_da.h: Add a define for the maximum amount of data that can be
contained in a defect list.
camcontrol.c: Update the readdefects() function to issue an initial
command to determine the length of the defect list, and
then use that length in the request for the full defect
list.
camcontrol.8: Add a note that some drives will report 0 defects available
if you don't request either the PLIST or GLIST.
Submitted by: Mark Johnston <markjdb@gmail.com> (original version)
MFC after: 3 days
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/scsi/scsi_da.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/cam/scsi/scsi_da.h b/sys/cam/scsi/scsi_da.h index 7605b1a..5799238 100644 --- a/sys/cam/scsi/scsi_da.h +++ b/sys/cam/scsi/scsi_da.h @@ -111,6 +111,7 @@ struct scsi_read_defect_data_10 u_int8_t reserved[4]; u_int8_t alloc_length[2]; +#define SRDD10_MAX_LENGTH 0xffff u_int8_t control; }; |