]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r332458:
authorken <ken@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 24 Apr 2018 13:52:39 +0000 (13:52 +0000)
committerken <ken@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 24 Apr 2018 13:52:39 +0000 (13:52 +0000)
commit66f2b6b0a2bdab62ff01c8610b9f0f2c3dcb4807
treee202bb91a2f5d5c6b7ac773b289da2a09ac51428
parent239ef42bc2937337c65cb79500d4750e6ad17abd
MFC r332458:
  ------------------------------------------------------------------------
  r332458 | ken | 2018-04-12 15:21:18 -0600 (Thu, 12 Apr 2018) | 34 lines

  Handle Programmable Early Warning for control commands in sa(4).

  When the tape position is inside the Early Warning area, the tape
  drive will return a sense key of NO SENSE, and an ASC/ASCQ of
  0x00,0x02, which means: End-of-partition/medium detected".  If
  this was in response to a control command like WRITE FILEMARKS,
  we correctly translate this as informational status and return
  0 from saerror().

  Programmable Early Warning should be handled the same way, but
  we weren't handling it that way.  As a result, if a PEW status
  (sense key of NO SENSE, ASC/ASCQ of 0x00,0x07, "Programmable early
  warning detected") came back in response to a WRITE FILEMARKS,
  we returned an error.

  The impact of this was that if an application was writing to a
  sa(4) device, and a PEW area was set (in the Device Configuration
  Extension subpage -- mode page 0x10, subpage 1), and a filemark
  needed to be written on close, we could wind up returning an error
  to the user on close because of a "failure" to write the filemarks.

  It actually isn't a failure, but rather just a status report from
  the drive, and shouldn't be treated as a failure.

  sys/cam/scsi/scsi_sa.c:
   For control commands in saerror(), treat asc/ascq 0x00,0x07
   the same as 0x00,{0-5} -- not an error.  Return 0, since
   the command actually did succeed.

  Reported by: Dr. Andreas Haakh <andreas@haakh.de>
  Tested by: Dr. Andreas Haakh <andreas@haakh.de>
  Sponsored by: Spectra Logic
  ------------------------------------------------------------------------

git-svn-id: svn://svn.freebsd.org/base/stable/10@332933 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/cam/scsi/scsi_sa.c