diff options
author | Dan Williams <dan.j.williams@intel.com> | 2014-02-06 15:23:07 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2014-03-15 13:18:53 -0400 |
commit | 3af74a3c07d93e34fce3d6c6dcd73676d8381d21 (patch) | |
tree | 5dcda82fb9fec85c5f25b7b7c418f735b219104b /include/scsi | |
parent | 4440e46d5db7b445a961a84444849b2a31fa7fd1 (diff) |
[SCSI] libsas: introduce scmd_dbg() to quiet false positive "timeout" messages
libsas sometimes short circuits timeouts to force commands into error
recovery. It is misleading to log that the command timed-out in
sas_scsi_timed_out() when in fact it was just queued for error handling.
It's also redundant in the case of a true timeout as libata eh will
detect and report timeouts via it's AC_ERR_TIMEOUT facility.
Given that some environments consider "timeout" errors to be indicative
of impending device failure demote the sas_scsi_timed_out() timeout
message to be disabled by default. This parallels ata_scsi_timed_out().
[jejb: checkpatch fix]
Reported-by: Xun Ni <xun.ni@intel.com>
Tested-by: Nelson Cheng <nelson.cheng@intel.com>
Acked-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi_device.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index d65fbec2533d..622e100561d2 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -235,12 +235,24 @@ struct scsi_dh_data { | |||
235 | #define sdev_printk(prefix, sdev, fmt, a...) \ | 235 | #define sdev_printk(prefix, sdev, fmt, a...) \ |
236 | dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a) | 236 | dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a) |
237 | 237 | ||
238 | #define sdev_dbg(sdev, fmt, a...) \ | ||
239 | dev_dbg(&(sdev)->sdev_gendev, fmt, ##a) | ||
240 | |||
238 | #define scmd_printk(prefix, scmd, fmt, a...) \ | 241 | #define scmd_printk(prefix, scmd, fmt, a...) \ |
239 | (scmd)->request->rq_disk ? \ | 242 | (scmd)->request->rq_disk ? \ |
240 | sdev_printk(prefix, (scmd)->device, "[%s] " fmt, \ | 243 | sdev_printk(prefix, (scmd)->device, "[%s] " fmt, \ |
241 | (scmd)->request->rq_disk->disk_name, ##a) : \ | 244 | (scmd)->request->rq_disk->disk_name, ##a) : \ |
242 | sdev_printk(prefix, (scmd)->device, fmt, ##a) | 245 | sdev_printk(prefix, (scmd)->device, fmt, ##a) |
243 | 246 | ||
247 | #define scmd_dbg(scmd, fmt, a...) \ | ||
248 | do { \ | ||
249 | if ((scmd)->request->rq_disk) \ | ||
250 | sdev_dbg((scmd)->device, "[%s] " fmt, \ | ||
251 | (scmd)->request->rq_disk->disk_name, ##a);\ | ||
252 | else \ | ||
253 | sdev_dbg((scmd)->device, fmt, ##a); \ | ||
254 | } while (0) | ||
255 | |||
244 | enum scsi_target_state { | 256 | enum scsi_target_state { |
245 | STARGET_CREATED = 1, | 257 | STARGET_CREATED = 1, |
246 | STARGET_RUNNING, | 258 | STARGET_RUNNING, |