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@xxxxxxx +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg)
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@xxxxxxx> 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: