Skip to contentSkip to conversation

Enable retries for SYNCRONIZE_CACHE commands

PATCH In review Hannes Reinecke 2 participants 2 messages May 4, 2010 – May 5, 2010 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Enable retries for SYNCRONIZE_CACHE commands

sd is using SYNCHRONIZE_CACHE to simulate barrier requests; however no error recovery is taking place as it's being injected from the block layer. So we should be enable retries here to clear any transient error.

---
 drivers/scsi/sd.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/scsi/sd.c +1 -0
index 8b827f3..de6c603 100644
@@ -1040,6 +1040,7 @@ static void sd_prepare_flush(struct request_queue *q, struct request *rq)
 {
 	rq->cmd_type = REQ_TYPE_BLOCK_PC;
 	rq->timeout = SD_TIMEOUT;
+	rq->retries = SD_MAX_RETRIES;
 	rq->cmd[0] = SYNCHRONIZE_CACHE;
 	rq->cmd_len = 10;
 }
Signature · 1 line
1.6.0.2
#1 lore raw
Quoted 16 lines · Hannes Reinecke

sd is using SYNCHRONIZE_CACHE to simulate barrier requests; however no error recovery is taking place as it's being injected from the block layer. So we should be enable retries here to clear any transient error.

---
 drivers/scsi/sd.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/scsi/sd.c +0 -0
index 8b827f3..de6c603 100644

drivers/scsi/sd.c static void sd_prepare_flush(struct request_queue *q, · line 1046

Quoted 7 lines
drivers/scsi/sd.c +1 -0
@@ -1040,6 +1040,7 @@ static void sd_prepare_flush(struct request_queue *q,
 struct request *rq) {
 	rq->cmd_type = REQ_TYPE_BLOCK_PC;
 	rq->timeout = SD_TIMEOUT;
+	rq->retries = SD_MAX_RETRIES;
 	rq->cmd[0] = SYNCHRONIZE_CACHE;
 	rq->cmd_len = 10;
 }

My patch already does that and also does it in sd_sync_cache().

http://kerneltrap.org/mailarchive/linux-scsi/2010/4/20/6884656

Please wait till Friday. I will try to find some time to update it to include another sysfs-device timeout value.
Sorry that I didn't manage to that so far, but I'm trying very hard to finish my thesis and the remaining two days per week for DDN, Lustre and Linux are then quickly taken by emergency tasks...

Thanks,
Bernd