[11/11] sd: fix a bug in deriving the FLUSH_TIMEOUT from the basic I/O timeout
diff mbox

Message ID 1411549247-6511-12-git-send-email-apw@canonical.com
State New
Headers show

Commit Message

Andy Whitcroft Sept. 24, 2014, 9 a.m. UTC
From: "K. Y. Srinivasan" <kys@microsoft.com>

Commit ID: 7e660100d85af860e7ad763202fff717adcdaacd added code to derive the
FLUSH_TIMEOUT from the basic I/O timeout. However, this patch did not use the
basic I/O timeout of the device. Fix this bug.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>

(backported from commit 26b9fd8b3452dcf0a8862e307ee23f442f63fb51)
BugLink: http://bugs.launchpad.net/bugs/1354397
Conflicts:
	drivers/scsi/sd.c
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 drivers/scsi/sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 2735c50..fb949ee 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -830,7 +830,7 @@  static int sd_setup_write_same_cmnd(struct scsi_device *sdp, struct request *rq)
 
 static int scsi_setup_flush_cmnd(struct scsi_device *sdp, struct request *rq)
 {
-	rq->timeout *= SD_FLUSH_TIMEOUT_MULTIPLIER;
+	rq->timeout = rq->q->rq_timeout * SD_FLUSH_TIMEOUT_MULTIPLIER;
 	rq->retries = SD_MAX_RETRIES;
 	rq->cmd[0] = SYNCHRONIZE_CACHE;
 	rq->cmd_len = 10;