From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: [PATCH REPOST] scsi: don't count non-failure CHECK_CONDITION as error Date: Thu, 14 Jan 2016 16:49:34 -0500 Message-ID: <20160114214934.GD3520@mtj.duckdns.org> References: <20160114214602.GC3520@mtj.duckdns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-yk0-f195.google.com ([209.85.160.195]:35067 "EHLO mail-yk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753592AbcANVtg (ORCPT ); Thu, 14 Jan 2016 16:49:36 -0500 Received: by mail-yk0-f195.google.com with SMTP id a85so33023579ykb.2 for ; Thu, 14 Jan 2016 13:49:36 -0800 (PST) Content-Disposition: inline In-Reply-To: <20160114214602.GC3520@mtj.duckdns.org> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, Dave Jones , kernel-team@fb.com 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 --- Hello, Reposting because the email address listed under "SCSI SUBSYSTEM", JBottomley@odin.com, bounced. James, can you please update the entry? Thanks. drivers/scsi/scsi_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);