提交 3af74a3c 编写于 作者: D Dan Williams 提交者: James Bottomley

[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: NXun Ni <xun.ni@intel.com>
Tested-by: NNelson Cheng <nelson.cheng@intel.com>
Acked-by: NLukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 4440e46d
......@@ -862,7 +862,7 @@ void sas_scsi_recover_host(struct Scsi_Host *shost)
enum blk_eh_timer_return sas_scsi_timed_out(struct scsi_cmnd *cmd)
{
scmd_printk(KERN_DEBUG, cmd, "command %p timed out\n", cmd);
scmd_dbg(cmd, "command %p timed out\n", cmd);
return BLK_EH_NOT_HANDLED;
}
......
......@@ -235,12 +235,24 @@ struct scsi_dh_data {
#define sdev_printk(prefix, sdev, fmt, a...) \
dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a)
#define sdev_dbg(sdev, fmt, a...) \
dev_dbg(&(sdev)->sdev_gendev, fmt, ##a)
#define scmd_printk(prefix, scmd, fmt, a...) \
(scmd)->request->rq_disk ? \
sdev_printk(prefix, (scmd)->device, "[%s] " fmt, \
(scmd)->request->rq_disk->disk_name, ##a) : \
sdev_printk(prefix, (scmd)->device, fmt, ##a)
#define scmd_dbg(scmd, fmt, a...) \
do { \
if ((scmd)->request->rq_disk) \
sdev_dbg((scmd)->device, "[%s] " fmt, \
(scmd)->request->rq_disk->disk_name, ##a);\
else \
sdev_dbg((scmd)->device, fmt, ##a); \
} while (0)
enum scsi_target_state {
STARGET_CREATED = 1,
STARGET_RUNNING,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册