]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r276835:
authorken <ken@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 3 Feb 2015 22:18:48 +0000 (22:18 +0000)
committerken <ken@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 3 Feb 2015 22:18:48 +0000 (22:18 +0000)
commit63c225dc12972816e90a36a7abcaa4dd893ebeb6
tree4d95f1906857b3992db717c0a1a08646b209c9fd
parent03b5cfbf65ca72fca1be2a906ac1d398cf3a593c
MFC r276835:

  r276835 | ken | 2015-01-08 09:58:40 -0700 (Thu, 08 Jan 2015) | 91 lines

  Improve camcontrol(8) handling of drive defect data.

  This includes a new summary mode (-s) for camcontrol defects that
  quickly tells the user the most important thing: how many defects
  are in the requested list.  The actual location of the defects is
  less important.

  Modern drives frequently have more than the 8191 defects that can
  be reported by the READ DEFECT DATA (10) command.  If they don't
  have that many grown defects, they certainly have more than 8191
  defects in the primary (i.e. factory) defect list.

  The READ DEFECT DATA (12) command allows for longer parameter
  lists, as well as indexing into the list of defects, and so allows
  reporting many more defects.

  This has been tested with HGST drives and Seagate drives, but
  does not fully work with Seagate drives.  Once I have a Seagate
  spec I may be able to determine whether it is possible to make it
  work with Seagate drives.

  scsi_da.h: Add a definition for the new long block defect
   format.

   Add bit and mask definitions for the new extended
   physical sector and bytes from index defect
   formats.

   Add a prototype for the new scsi_read_defects() CDB
   building function.

  scsi_da.c: Add a new scsi_read_defects() CDB building function.
   camcontrol(8) was previously composing CDBs manually.
   This is long overdue.

  camcontrol.c: Revamp the camcontrol defects subcommand.  We now
   go through multiple stages in trying to get defect
   data off the drive while avoiding various drive
   firmware quirks.

   We start off by requesting the defect header with
   the 10 byte command.  If we're in summary mode (-s)
   and the drive reports fewer defects than can be
   represented in the 10 byte header, we're done.
   Otherwise, we know that we need to issue the
   12 byte command if the drive reports the maximum
   number of defects.

   If we're in summary mode, we're done if we get a
   good response back when asking for the 12 byte header.

   If the user has asked for the full list, then we
   use the address descriptor index field in the 12
   byte CDB to step through the list in 64K chunks.
   64K is small enough to work with most any ancient
   or modern SCSI controller.

   Add support for printing the new long block defect
   format, as well as the extended physical sector and
   bytes from index formats.  I don't have any drives
   that support the new formats.

   Add a hexadecimal output format that can be turned
   on with -X.

   Add a quiet mode (-q) that can be turned on with
   the summary mode (-s) to just print out a number.

   Revamp the error detection and recovery code for
   the defects command to work with HGST drives.

   Call the new scsi_read_defects() CDB building
   function instead of rolling the CDB ourselves.

   Pay attention to the residual from the defect list
   request when printing it out, so we don't run off
   the end of the list.

   Use the new scsi_nv library routines to convert
   from strings to numbers and back.

  camcontrol.8: Document the new defect formats (longblock, extbfi,
   extphys) and command line options (-q, -s, -S and
   -X) for the defects subcommand.

   Explain a little more about what drives generally
   do and don't support.

Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@278170 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sbin/camcontrol/camcontrol.8
sbin/camcontrol/camcontrol.c
sys/cam/scsi/scsi_da.c
sys/cam/scsi/scsi_da.h