Re: [PATCH] scsi: don't count non-failure CHECK_CONDITION as error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/14/2016 10:46 PM, Tejun Heo wrote:
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@xxxxxxxxxx>
Reported-by: Dave Jones <dsj@xxxxxx>
---
  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);

Reviewed-by: Hannes Reinecke <hare@xxxxxxxx>

Hannes
--
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@xxxxxxx			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux