Commit e3b3e624 authored by Mike Christie's avatar Mike Christie Committed by James Bottomley

[SCSI] scsi/block: increase flush/sync timeout

We have been seeing the flush request timeout with a wide
range of hardware from tgt+iser to FC targets from a major vendor.

After discussions about if the value should be configurable and
what the best value should be, this patch just increases the flush/sync
cache timeout to 1 minute. 2 minutes was determined to be too long, and
making it configurable was troublesome for users.

This patch was made over Linus's tree. It is not made over scsi-misc
or scsi-rc-fixes, because Linus's had block layer changes that my
patch was built over.
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Acked-by: default avatarJens Axboe <jaxboe@fusionio.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 1c1acab0
...@@ -477,7 +477,7 @@ static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq) ...@@ -477,7 +477,7 @@ static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq)
static int scsi_setup_flush_cmnd(struct scsi_device *sdp, struct request *rq) static int scsi_setup_flush_cmnd(struct scsi_device *sdp, struct request *rq)
{ {
rq->timeout = SD_TIMEOUT; rq->timeout = SD_FLUSH_TIMEOUT;
rq->retries = SD_MAX_RETRIES; rq->retries = SD_MAX_RETRIES;
rq->cmd[0] = SYNCHRONIZE_CACHE; rq->cmd[0] = SYNCHRONIZE_CACHE;
rq->cmd_len = 10; rq->cmd_len = 10;
...@@ -1072,7 +1072,7 @@ static int sd_sync_cache(struct scsi_disk *sdkp) ...@@ -1072,7 +1072,7 @@ static int sd_sync_cache(struct scsi_disk *sdkp)
* flush everything. * flush everything.
*/ */
res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, &sshdr, res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, &sshdr,
SD_TIMEOUT, SD_MAX_RETRIES, NULL); SD_FLUSH_TIMEOUT, SD_MAX_RETRIES, NULL);
if (res == 0) if (res == 0)
break; break;
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
*/ */
#define SD_TIMEOUT (30 * HZ) #define SD_TIMEOUT (30 * HZ)
#define SD_MOD_TIMEOUT (75 * HZ) #define SD_MOD_TIMEOUT (75 * HZ)
#define SD_FLUSH_TIMEOUT (60 * HZ)
/* /*
* Number of allowed retries * Number of allowed retries
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment