Skip to content

Commit c213e14

Browse files
hreineckeJames Bottomley
authored andcommitted
[SCSI] Enable retries for SYNCRONIZE_CACHE commands to fix I/O error
Some arrays are giving I/O errors with ext3 filesystems when SYNCHRONIZE_CACHE gets a UNIT_ATTENTION. What is happening is that these commands have no retries, so the UNIT_ATTENTION causes the barrier to fail. We should be enable retries here to clear any transient error and allow the barrier to succeed. Signed-off-by: Hannes Reinecke <hare@suse.de> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1 parent 5447ed6 commit c213e14

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/scsi/sd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,7 @@ static void sd_prepare_flush(struct request_queue *q, struct request *rq)
10401040
{
10411041
rq->cmd_type = REQ_TYPE_BLOCK_PC;
10421042
rq->timeout = SD_TIMEOUT;
1043+
rq->retries = SD_MAX_RETRIES;
10431044
rq->cmd[0] = SYNCHRONIZE_CACHE;
10441045
rq->cmd_len = 10;
10451046
}

0 commit comments

Comments
 (0)