All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: don't count non-failure CHECK_CONDITION as error
@ 2016-01-14 21:46 Tejun Heo
  2016-01-14 21:49 ` [PATCH REPOST] " Tejun Heo
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Tejun Heo @ 2016-01-14 21:46 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, Dave Jones, kernel-team

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 <tj@kernel.org>
Reported-by: Dave Jones <dsj@fb.com>
---
 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);

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-01-15 19:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-14 21:46 [PATCH] scsi: don't count non-failure CHECK_CONDITION as error Tejun Heo
2016-01-14 21:49 ` [PATCH REPOST] " Tejun Heo
2016-01-15 10:04 ` [PATCH] " Hannes Reinecke
2016-01-15 15:46 ` James Bottomley
2016-01-15 15:55   ` James Bottomley
2016-01-15 16:50     ` Douglas Gilbert
2016-01-15 18:35       ` James Bottomley
2016-01-15 18:42         ` Tejun Heo
2016-01-15 19:09           ` James Bottomley
2016-01-15 19:27             ` Tejun Heo
2016-01-15 19:36               ` James Bottomley
2016-01-15 19:40                 ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.