From patchwork Thu Jan 14 21:46:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 8035501 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 DECE49F1C0 for ; Thu, 14 Jan 2016 21:46:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15CBE204F6 for ; Thu, 14 Jan 2016 21:46:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18A6B204D9 for ; Thu, 14 Jan 2016 21:46:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754330AbcANVqG (ORCPT ); Thu, 14 Jan 2016 16:46:06 -0500 Received: from mail-yk0-f172.google.com ([209.85.160.172]:36279 "EHLO mail-yk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754585AbcANVqE (ORCPT ); Thu, 14 Jan 2016 16:46:04 -0500 Received: by mail-yk0-f172.google.com with SMTP id v14so429167638ykd.3 for ; Thu, 14 Jan 2016 13:46:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=KQEGYRBZkBjPW8EpXCPf+XOeqbVrY3TzQYyR7ljvZrI=; b=G8BJYV6+OAmSMuOfTtVTRazixH9zmXeDHZE5BHxSZtUNZ14CKl5MIurl5C0waQjuml tuYZWeHiPIAqMtn9iJnT8PaAmjA10VOmREoC4Ki45MK0kooSCNuFnzXfDPTtZkhWjf67 ZBe6t9fDx3OXvwd0y3M7rCnYXP0QRLiNdlY1Hp5I8nrZ+RElbycM41/8VwGFl05ERHMT KVsPItgWflkHm8BEVwE0ou5sdWlI8nncDo/sOcDbP/kDOfxyskzvXrgyHnYR7H/u9DJE 0751mL8Yz6btVmAmW1+PGitwiVq4B0jM72YFw4OoRtY0SgnDHUYTDCP1pN8KAboQS79S nQIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mime-version:content-type:content-disposition:user-agent; bh=KQEGYRBZkBjPW8EpXCPf+XOeqbVrY3TzQYyR7ljvZrI=; b=EGUGcjVULMy6xxAEm6hA84QVWRrRdK+70m7eJqdPCsky0kIjvCCMo1HbmKX0nqqWE5 fwEcb25fqK46y5pEEw4vzohBM0ch/D5RiYxFWRnQQo/fihMrV6pvxsKE3VHvqCN49had Z10adOdvF8yoqzmTro8rcHCW9IFnNTqw1cV7/l7tP02NyT1Zd4Vem6y5bw/57XMPkSKo Ucwc6SxgIVPGd6N5wnxIf7aBIqeReO8HtXA7SiDIFPfmnLQJVaaON9Y0ENNM/Gmwf/Rc vSkdk4aq56f062d4fuu96iSgxhQ7hEQEg6FagmCBG+m84mbKZdesiXbrETNjrjHaPY0o b+OQ== X-Gm-Message-State: ALoCoQmfXWsXWq4g9gdQG/34me6Pl3IMru82rjZLx1Wu1PxUSJ3esEoT3qKrWJxN0FonhDc6e5MTmhFmo6BGjZbtCo9UqEubCw== X-Received: by 10.129.132.79 with SMTP id u76mr4955015ywf.234.1452807963435; Thu, 14 Jan 2016 13:46:03 -0800 (PST) Received: from localhost ([2620:10d:c091:200::a:af15]) by smtp.gmail.com with ESMTPSA id i67sm5849911ywf.34.2016.01.14.13.46.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jan 2016 13:46:02 -0800 (PST) Date: Thu, 14 Jan 2016 16:46:02 -0500 From: Tejun Heo To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, Dave Jones , kernel-team@fb.com Subject: [PATCH] scsi: don't count non-failure CHECK_CONDITION as error Message-ID: <20160114214602.GC3520@mtj.duckdns.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 SCSI command completion path bumps ioerr_cnt whenever scsi_cmd->result isn't zero; unfortunately, this means that non-error sense reporting bumps the counter too. This is pronounced with ATA passthrough commands because most of them explicitly request the resulting taskfile to be transported via sense data bumping the count unconditionally. Don't bump the counter if scsi_cmd->result simply indicates that sense data is available. Signed-off-by: Tejun Heo Reported-by: Dave Jones Reviewed-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 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 diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index fa6b2c4..e90e3f7 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1622,7 +1622,8 @@ static void scsi_softirq_done(struct request *rq) INIT_LIST_HEAD(&cmd->eh_entry); atomic_inc(&cmd->device->iodone_cnt); - if (cmd->result) + if (cmd->result && + cmd->result != ((DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION)) atomic_inc(&cmd->device->ioerr_cnt); disposition = scsi_decide_disposition(cmd);