Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e4fabb6 authored by Kai Makisara's avatar Kai Makisara Committed by Martin K. Petersen
Browse files

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: default avatarKai Mäkisara <kai.makisara@kolumbus.fi>
Reviewed-by: default avatarLaurence Oberman <loberman@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 71892418
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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)
				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 &&