[PATCH 6/7] SYNCHRONIZE_CACHE command used fixed value

Bernd Schubert
2008-11-26T18:31:30Z

Switch to adjustable timeout value for scsi SYNCHRONIZE_CACHE commands.
We have been running into problems with fixed values on troublesome devices.

Signed-off-by: Bernd Schubert <bs@q-leap.de>

---
drivers/scsi/sd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6/drivers/scsi/sd.c
===================================================================
--- linux-2.6.orig/drivers/scsi/sd.c
+++ linux-2.6/drivers/scsi/sd.c
@@ -884,7 +884,8 @@ static int sd_sync_cache(struct scsi_dis
* flush everything.
*/
res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, &sshdr,
- SD_TIMEOUT, SD_MAX_RETRIES);
+ sdp->request_queue->rq_timeout,
+ SD_MAX_RETRIES);
if (res == 0)
break;
}
@@ -903,7 +904,7 @@ static int sd_sync_cache(struct scsi_dis
static void sd_prepare_flush(struct request_queue *q, struct request *rq)
{
rq->cmd_type = REQ_TYPE_BLOCK_PC;
- rq->timeout = SD_TIMEOUT;
+ rq->timeout = q->rq_timeout;
rq->cmd[0] = SYNCHRONIZE_CACHE;
rq->cmd_len = 10;
}