diff options
author | Kenneth D. Merry <ken@FreeBSD.org> | 2012-06-22 18:57:06 +0000 |
---|---|---|
committer | Kenneth D. Merry <ken@FreeBSD.org> | 2012-06-22 18:57:06 +0000 |
commit | 7027b9cda4f7565639589c0c5f280a284f9eb87e (patch) | |
tree | d3b9496b47aa9edb049facfa7a63a03202522d56 /sbin/camcontrol/camcontrol.8 | |
parent | ffdd0c7db3d7d81f27a550564b0158cdd86a3f41 (diff) | |
download | src-7027b9cda4f7565639589c0c5f280a284f9eb87e.tar.gz src-7027b9cda4f7565639589c0c5f280a284f9eb87e.zip |
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
Notes
Notes:
svn path=/head/; revision=237452
Diffstat (limited to 'sbin/camcontrol/camcontrol.8')
-rw-r--r-- | sbin/camcontrol/camcontrol.8 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8 index bf728c6e3e2c..66a45eb7af1d 100644 --- a/sbin/camcontrol/camcontrol.8 +++ b/sbin/camcontrol/camcontrol.8 @@ -497,6 +497,8 @@ is specified, .Nm will print out the number of defects given in the READ DEFECT DATA header returned from the drive. +Some drives will report 0 defects if neither the primary or grown defect +lists are requested. .It Ic modepage Allows the user to display and optionally edit a SCSI mode page. The mode |