[SCSI] fc class: fail fast bsg requests
authorMike Christie <[email protected]>
Thu, 5 Nov 2009 17:18:09 +0000 (11:18 -0600)
committerJames Bottomley <[email protected]>
Fri, 4 Dec 2009 18:01:32 +0000 (12:01 -0600)
If the port state is blocked and the fast io fail tmo has
fired then this patch will fail bsg requests immediately.
This is needed if userspace is sending IOs to test the transport
like with fcping, so it will not have to wait for the dev loss tmo.
With this patch he bsg req fast io fail code behaves like the normal
and sg io/passthrough fast io fail.

Signed-off-by: Mike Christie <[email protected]>
Acked-By: James Smart <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
drivers/scsi/scsi_transport_fc.c

index 3ce56b3b2cd7939ae82f4c39ea9f85d994259aa4..600502aa3b61a97e4280d3b9ee5ae79aa2efcb26 100644 (file)
@@ -3809,8 +3809,9 @@ fc_bsg_request_handler(struct request_queue *q, struct Scsi_Host *shost,
                return;
 
        while (!blk_queue_plugged(q)) {
-               if (rport && (rport->port_state == FC_PORTSTATE_BLOCKED))
-                               break;
+               if (rport && (rport->port_state == FC_PORTSTATE_BLOCKED) &&
+                   !(rport->flags & FC_RPORT_FAST_FAIL_TIMEDOUT))
+                       break;
 
                req = blk_fetch_request(q);
                if (!req)