From: Mike Christie Date: Thu, 5 Nov 2009 17:18:09 +0000 (-0600) Subject: fc class: fail fast bsg requests X-Git-Tag: firefly_0821_release~10186^2~1785 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=285f4f1123e1c977eb5dfa7704cc6356be079581;p=firefly-linux-kernel-4.4.55.git fc class: fail fast bsg requests commit 2bc1c59dbdefdb6f9767e06efb86bbdb2923a8be upstream. 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 Acked-By: James Smart Signed-off-by: James Bottomley Cc: maximilian attems Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 64084aa6e29b..db02e31bae39 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -3796,8 +3796,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)