]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.12/fc-class-fail-fast-bsg-requests.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.12 / fc-class-fail-fast-bsg-requests.patch
CommitLineData
85291088
GKH
1From 2bc1c59dbdefdb6f9767e06efb86bbdb2923a8be Mon Sep 17 00:00:00 2001
2From: Mike Christie <michaelc@cs.wisc.edu>
3Date: Thu, 5 Nov 2009 11:18:09 -0600
4Subject: [SCSI] fc class: fail fast bsg requests
5
6From: Mike Christie <michaelc@cs.wisc.edu>
7
8commit 2bc1c59dbdefdb6f9767e06efb86bbdb2923a8be upstream.
9
10If the port state is blocked and the fast io fail tmo has
11fired then this patch will fail bsg requests immediately.
12This is needed if userspace is sending IOs to test the transport
13like with fcping, so it will not have to wait for the dev loss tmo.
14With this patch he bsg req fast io fail code behaves like the normal
15and sg io/passthrough fast io fail.
16
17Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
18Acked-By: James Smart <james.smart@emulex.com>
19Signed-off-by: James Bottomley <James.Bottomley@suse.de>
20Cc: maximilian attems <max@stro.at>
21Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22
23---
24 drivers/scsi/scsi_transport_fc.c | 5 +++--
25 1 file changed, 3 insertions(+), 2 deletions(-)
26
27--- a/drivers/scsi/scsi_transport_fc.c
28+++ b/drivers/scsi/scsi_transport_fc.c
29@@ -3796,8 +3796,9 @@ fc_bsg_request_handler(struct request_qu
30 return;
31
32 while (!blk_queue_plugged(q)) {
33- if (rport && (rport->port_state == FC_PORTSTATE_BLOCKED))
34- break;
35+ if (rport && (rport->port_state == FC_PORTSTATE_BLOCKED) &&
36+ !(rport->flags & FC_RPORT_FAST_FAIL_TIMEDOUT))
37+ break;
38
39 req = blk_fetch_request(q);
40 if (!req)