Skip to content

Commit

Permalink
st: clear ILI if Medium Error
Browse files Browse the repository at this point in the history
Some drives set the ILI flag together with MEDIUM ERROR sense code.
Clear the ILI flag in this case so that the medium error will be
handled.  The problem was reported by Maurizio Lombardi.

Signed-off-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Kai Makisara authored and Martin K. Petersen committed Apr 26, 2016
1 parent 7189241 commit 5e4fabb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/scsi/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -1974,9 +1974,12 @@ static long read_tape(struct scsi_tape *STp, long count,
transfer = (int)cmdstatp->uremainder64;
else
transfer = 0;
if (STp->block_size == 0 &&
cmdstatp->sense_hdr.sense_key == MEDIUM_ERROR)
transfer = bytes;
if (cmdstatp->sense_hdr.sense_key == MEDIUM_ERROR) {
if (STp->block_size == 0)
transfer = bytes;
/* Some drives set ILI with MEDIUM ERROR */
cmdstatp->flags &= ~SENSE_ILI;
}

if (cmdstatp->flags & SENSE_ILI) { /* ILI */
if (STp->block_size == 0 &&
Expand Down

0 comments on commit 5e4fabb

Please sign in to comment.