* [PATCH] Undo __scsi_kill_request()
@ 2007-12-06 8:28 Hannes Reinecke
0 siblings, 0 replies; only message in thread
From: Hannes Reinecke @ 2007-12-06 8:28 UTC (permalink / raw)
To: James Bottomley, SCSI Mailing List
[-- 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:
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-12-06 8:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-06 8:28 [PATCH] Undo __scsi_kill_request() Hannes Reinecke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).