diff options
author | Kai Makisara <Kai.Makisara@kolumbus.fi> | 2016-04-18 07:47:18 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-04-26 04:08:16 +0200 |
commit | 5e4fabb6eb058f6d473e22b6db3ef299acf00f1c (patch) | |
tree | ceedd2041da007aba8b1aac46ad1072e8119511c /drivers/scsi/st.c | |
parent | lpfc: remove incorrect lockdep assertion (diff) | |
download | linux-5e4fabb6eb058f6d473e22b6db3ef299acf00f1c.tar.xz linux-5e4fabb6eb058f6d473e22b6db3ef299acf00f1c.zip |
st: clear ILI if Medium Error
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>
Diffstat (limited to '')
-rw-r--r-- | drivers/scsi/st.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index dbf1882cfbac..7af5226aa55b 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -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 && |