From: Brian King <brking@us.ibm.com>
To: axboe@suse.de
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
brking@us.ibm.com
Subject: [PATCH 1/1] blk: Fix SG_IO ioctl failure retry looping
Date: Thu, 02 Feb 2006 11:29:44 -0600 [thread overview]
Message-ID: <200602021729.k12HTtmg018944@d03av02.boulder.ibm.com> (raw)
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>
---
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 */
_
next reply other threads:[~2006-02-02 17:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-02 17:29 Brian King [this message]
2006-02-02 17:40 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200602021729.k12HTtmg018944@d03av02.boulder.ibm.com \
--to=brking@us.ibm.com \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®