diff options
author | Jens Axboe <axboe@suse.de> | 2006-02-03 02:37:08 -0500 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-02-08 04:07:13 -0500 |
commit | 01840f9c9d7ae366311302077ace6bc39169399b (patch) | |
tree | de26c62e94ab279e18b8278cb7d74f1d14290a0c /block/scsi_ioctl.c | |
parent | ac171c46667c1cb2ee9e22312291df6ed78e1b6e (diff) |
[PATCH] blk: Fix SG_IO ioctl failure retry looping
When issuing an SG_IO ioctl through sd that resulted in an unrecoverable
error, a nearly infinite retry loop was discovered. This is due to the
fact that the block layer SG_IO code is not setting up rq->retries. This
patch also fixes up the sg_scsi_ioctl path.
Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block/scsi_ioctl.c')
-rw-r--r-- | block/scsi_ioctl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index cc72210687eb..24f7af9d0abc 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -310,6 +310,8 @@ static int sg_io(struct file *file, request_queue_t *q, | |||
310 | if (!rq->timeout) | 310 | if (!rq->timeout) |
311 | rq->timeout = BLK_DEFAULT_TIMEOUT; | 311 | rq->timeout = BLK_DEFAULT_TIMEOUT; |
312 | 312 | ||
313 | rq->retries = 0; | ||
314 | |||
313 | start_time = jiffies; | 315 | start_time = jiffies; |
314 | 316 | ||
315 | /* ignore return value. All information is passed back to caller | 317 | /* ignore return value. All information is passed back to caller |
@@ -427,6 +429,7 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q, | |||
427 | rq->data = buffer; | 429 | rq->data = buffer; |
428 | rq->data_len = bytes; | 430 | rq->data_len = bytes; |
429 | rq->flags |= REQ_BLOCK_PC; | 431 | rq->flags |= REQ_BLOCK_PC; |
432 | rq->retries = 0; | ||
430 | 433 | ||
431 | blk_execute_rq(q, bd_disk, rq, 0); | 434 | blk_execute_rq(q, bd_disk, rq, 0); |
432 | err = rq->errors & 0xff; /* only 8 bit SCSI status */ | 435 | err = rq->errors & 0xff; /* only 8 bit SCSI status */ |