From patchwork Mon Apr 18 12:06:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurence Oberman X-Patchwork-Id: 8871851 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5E5D79F1C1 for ; Mon, 18 Apr 2016 12:06:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E1AD202AE for ; Mon, 18 Apr 2016 12:06:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 345CA202A1 for ; Mon, 18 Apr 2016 12:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbcDRMGT (ORCPT ); Mon, 18 Apr 2016 08:06:19 -0400 Received: from mx5-phx2.redhat.com ([209.132.183.37]:60177 "EHLO mx5-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752324AbcDRMGT convert rfc822-to-8bit (ORCPT ); Mon, 18 Apr 2016 08:06:19 -0400 Received: from zmail22.collab.prod.int.phx2.redhat.com (zmail22.collab.prod.int.phx2.redhat.com [10.5.83.26]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3IC661n046946; Mon, 18 Apr 2016 08:06:07 -0400 Date: Mon, 18 Apr 2016 08:06:06 -0400 (EDT) From: Laurence Oberman To: Kai Makisara Cc: linux-scsi@vger.kernel.org, mlombard@redhat.com Message-ID: <1916314668.30408094.1460981166841.JavaMail.zimbra@redhat.com> In-Reply-To: References: Subject: Re: [PATCH] st: clear ILI if Medium Error MIME-Version: 1.0 X-Originating-IP: [10.36.7.194] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF38 (Linux)/8.0.6_GA_5922) Thread-Topic: clear ILI if Medium Error Thread-Index: CNEmqCpSY+zlHWFFjHD8vruVulb6dw== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Looks good Reviewed-by Laurence Oberman Laurence Oberman Principal Software Maintenance Engineer Red Hat Global Support Services ----- Original Message ----- From: "Kai Makisara" To: linux-scsi@vger.kernel.org Cc: mlombard@redhat.com Sent: Monday, April 18, 2016 1:47:18 AM Subject: [PATCH] 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 --- drivers/scsi/st.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/scsi/st.c 2016-04-17 21:22:15.671897001 +0300 +++ b/drivers/scsi/st.c 2016-04-17 22:25:39.234321293 +0300 @@ -1974,9 +1974,12 @@ static long read_tape(struct scsi_tape * 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 &&