diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-05 14:49:18 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-12-13 15:29:14 -0800 |
commit | 5c7c64831c51516034a7099ba25718f7aaed19e4 (patch) | |
tree | bcb8ea06253c5f990c5bf6cde4379c0244b0c4c7 /block | |
parent | fc27e1db48a5b3d551a50bbe6770577ce4e64d51 (diff) | |
download | lwn-5c7c64831c51516034a7099ba25718f7aaed19e4.tar.gz lwn-5c7c64831c51516034a7099ba25718f7aaed19e4.zip |
Enforce a minimum SG_IO timeout
commit f2f1fa78a155524b849edf359e42a3001ea652c0 upstream.
There's no point in having too short SG_IO timeouts, since if the
command does end up timing out, we'll end up through the reset sequence
that is several seconds long in order to abort the command that timed
out.
As a result, shorter timeouts than a few seconds simply do not make
sense, as the recovery would be longer than the timeout itself.
Add a BLK_MIN_SG_TIMEOUT to match the existign BLK_DEFAULT_SG_TIMEOUT.
Suggested-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'block')
-rw-r--r-- | block/bsg.c | 2 | ||||
-rw-r--r-- | block/scsi_ioctl.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/block/bsg.c b/block/bsg.c index 0aae8d7ba99c..9cfbea8f2b83 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -202,6 +202,8 @@ static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq, rq->timeout = q->sg_timeout; if (!rq->timeout) rq->timeout = BLK_DEFAULT_SG_TIMEOUT; + if (rq->timeout < BLK_MIN_SG_TIMEOUT) + rq->timeout = BLK_MIN_SG_TIMEOUT; return 0; } diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index ec4b7f234626..dd3281a5fb5f 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -208,6 +208,8 @@ static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq, rq->timeout = q->sg_timeout; if (!rq->timeout) rq->timeout = BLK_DEFAULT_SG_TIMEOUT; + if (rq->timeout < BLK_MIN_SG_TIMEOUT) + rq->timeout = BLK_MIN_SG_TIMEOUT; return 0; } |