All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: James Bottomley <James.Bottomley@SteelEye.com>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: [PATCH] Undo __scsi_kill_request()
Date: Thu, 06 Dec 2007 09:28:23 +0100	[thread overview]
Message-ID: <4757B2A7.6050603@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

Hi all,

the main goal of using FAILFAST is to have requests terminated
early if the link to the target is lost. This is indicated by
the device state SDEV_BLOCK.
So we only have to check for the FAILFAST flag when we check
the queue state in scsi_prep_fn().

This patch reverts parts of the original patch
'Do not requeue requests if REQ_FAILFAST is set'
as the return values of ->queuecommand() should not be affected
by the FAILFAST setting.

James, please apply.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)

[-- Attachment #2: scsi-undo-__kill-request --]
[-- Type: text/plain, Size: 1256 bytes --]

Remove __scsi_kill_request()

We only have to evaluate the FAILFAST flag if the device is in
status SDEV_BLOCK, as this indicates a link failure.
The return status of ->queuecommand() should not be affected by
this, so remove the check there.

Signed-off-by: Hannes Reinecke <hare@suse.de>

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 1148c40..6f4862b 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1424,17 +1424,6 @@ static inline int scsi_host_queue_ready(struct request_queue *q,
 	return 1;
 }
 
-static void __scsi_kill_request(struct request *req)
-{
-	struct scsi_cmnd *cmd = req->special;
-	struct scsi_device *sdev = cmd->device;
-
-	cmd->result = DID_NO_CONNECT << 16;
-	atomic_inc(&cmd->device->iorequest_cnt);
-	sdev->device_busy--;
-	__scsi_done(cmd);
-}
-
 /*
  * Kill a request for a dead device
  */
@@ -1639,12 +1628,9 @@ static void scsi_request_fn(struct request_queue *q)
 	 * later time.
 	 */
 	spin_lock_irq(q->queue_lock);
-	if (unlikely(req->cmd_flags & REQ_FAILFAST))
-		__scsi_kill_request(req);
-	else {
-		blk_requeue_request(q, req);
-		sdev->device_busy--;
-	}
+	blk_requeue_request(q, req);
+	sdev->device_busy--;
+
 	if(sdev->device_busy == 0)
 		blk_plug_device(q);
  out:

                 reply	other threads:[~2007-12-06  8:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4757B2A7.6050603@suse.de \
    --to=hare@suse.de \
    --cc=James.Bottomley@SteelEye.com \
    --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 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.