[PATCH 1/1] blk: Fix SG_IO ioctl failure retry looping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>
---

 linux-2.6-bjking1/block/scsi_ioctl.c |    2 ++
 1 files changed, 2 insertions(+)

diff -puN block/scsi_ioctl.c~scsi_ioctl_retries block/scsi_ioctl.c
--- linux-2.6/block/scsi_ioctl.c~scsi_ioctl_retries	2006-02-02 11:07:50.000000000 -0600
+++ linux-2.6-bjking1/block/scsi_ioctl.c	2006-02-02 11:09:11.000000000 -0600
@@ -309,6 +309,7 @@ static int sg_io(struct file *file, requ
 		rq->timeout = q->sg_timeout;
 	if (!rq->timeout)
 		rq->timeout = BLK_DEFAULT_TIMEOUT;
+	rq->retries = 0;
 
 	start_time = jiffies;
 
@@ -427,6 +428,7 @@ static int sg_scsi_ioctl(struct file *fi
 	rq->data = buffer;
 	rq->data_len = bytes;
 	rq->flags |= REQ_BLOCK_PC;
+	rq->retries = 0;
 
 	blk_execute_rq(q, bd_disk, rq, 0);
 	err = rq->errors & 0xff;	/* only 8 bit SCSI status */
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux