All of lore.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: Jens Axboe <axboe@suse.de>
Cc: ck@vds.kolivas.org,
	linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [ck] 2.6.11-ck6
Date: Sun, 1 May 2005 10:14:56 +1000	[thread overview]
Message-ID: <200505011014.58883.kernel@kolivas.org> (raw)
In-Reply-To: <20050430201321.GA8147@suse.de>


[-- Attachment #1.1: Type: text/plain, Size: 569 bytes --]

On Sun, 1 May 2005 06:13, Jens Axboe wrote:
> On Sun, May 01 2005, Con Kolivas wrote:
> > +scsi-dead-device.diff
> > A fix for a scsi related hang that seems to hit many -ck users
>
> This looks strange, like a fix and a half. You should just apply the
> patch I sent you originally, weeks ago, changing sdev->sdev_lock to
> &q->__queue_lock.

rarrgh

Thanks for keeping an eye out on for this. Unfortunately you sent more than 
one patch at different times and it looks like I included the wrong one then? 
This is the patch I (tried to) include.

Con

[-- Attachment #1.2: scsi-dead-device --]
[-- Type: text/x-diff, Size: 2035 bytes --]

===== drivers/scsi/scsi_lib.c 1.151 vs edited =====
--- 1.151/drivers/scsi/scsi_lib.c	2005-02-17 20:17:22 +01:00
+++ edited/drivers/scsi/scsi_lib.c	2005-03-18 12:33:09 +01:00
@@ -1233,6 +1233,22 @@ static inline int scsi_host_queue_ready(
 }
 
 /*
+ * Kill requests for a dead device
+ */
+static void scsi_kill_requests(request_queue_t *q)
+{
+	struct request *req;
+
+	while ((req = elv_next_request(q)) != NULL) {
+		blkdev_dequeue_request(req);
+		req->flags |= REQ_QUIET;
+		while (end_that_request_first(req, 0, req->nr_sectors))
+			;
+		end_that_request_last(req);
+	}
+}
+
+/*
  * Function:    scsi_request_fn()
  *
  * Purpose:     Main strategy routine for SCSI.
@@ -1246,10 +1262,16 @@ static inline int scsi_host_queue_ready(
 static void scsi_request_fn(struct request_queue *q)
 {
 	struct scsi_device *sdev = q->queuedata;
-	struct Scsi_Host *shost = sdev->host;
+	struct Scsi_Host *shost;
 	struct scsi_cmnd *cmd;
 	struct request *req;
 
+	if (!sdev) {
+		printk("scsi: killing requests for dead queue\n");
+		scsi_kill_requests(q);
+		return;
+	}
+
 	if(!get_device(&sdev->sdev_gendev))
 		/* We must be tearing the block queue down already */
 		return;
@@ -1258,6 +1280,7 @@ static void scsi_request_fn(struct reque
 	 * To start with, we keep looping until the queue is empty, or until
 	 * the host is no longer able to accept any more requests.
 	 */
+	shost = sdev->host;
 	while (!blk_queue_plugged(q)) {
 		int rtn;
 		/*
===== drivers/scsi/scsi_sysfs.c 1.69 vs edited =====
--- 1.69/drivers/scsi/scsi_sysfs.c	2005-02-17 02:05:37 +01:00
+++ edited/drivers/scsi/scsi_sysfs.c	2005-03-18 12:32:57 +01:00
@@ -168,8 +168,10 @@ void scsi_device_dev_release(struct devi
 	list_del(&sdev->starved_entry);
 	spin_unlock_irqrestore(sdev->host->host_lock, flags);
 
-	if (sdev->request_queue)
+	if (sdev->request_queue) {
+		sdev->request_queue->queuedata = NULL;
 		scsi_free_queue(sdev->request_queue);
+	}
 
 	scsi_target_reap(scsi_target(sdev));
 

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-05-01  0:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-30 14:17 2.6.11-ck6 Con Kolivas
2005-04-30 20:13 ` [ck] 2.6.11-ck6 Jens Axboe
2005-05-01  0:14   ` Con Kolivas [this message]
2005-05-01  0:33     ` Con Kolivas
2005-05-01  1:31       ` 2.6.11-ck7 Con Kolivas
2005-05-01 11:42       ` [ck] 2.6.11-ck6 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=200505011014.58883.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=axboe@suse.de \
    --cc=ck@vds.kolivas.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.