]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.7.4/tcm_fc-do-not-report-target-role-when-target-is-not-defined.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.7.4 / tcm_fc-do-not-report-target-role-when-target-is-not-defined.patch
CommitLineData
cb01949f
GKH
1From edec8dfefa1f372b2dd8197da555352e76a10c03 Mon Sep 17 00:00:00 2001
2From: Mark Rustad <mark.d.rustad@intel.com>
3Date: Fri, 21 Dec 2012 10:58:19 -0800
4Subject: tcm_fc: Do not report target role when target is not defined
5
6From: Mark Rustad <mark.d.rustad@intel.com>
7
8commit edec8dfefa1f372b2dd8197da555352e76a10c03 upstream.
9
10Clear the target role when no target is provided for
11the node performing a PRLI.
12
13Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
14Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
15Acked by Robert Love <robert.w.love@intel.com>
16Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
17Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18
19---
20 drivers/target/tcm_fc/tfc_sess.c | 10 ++++++++--
21 1 file changed, 8 insertions(+), 2 deletions(-)
22
23--- a/drivers/target/tcm_fc/tfc_sess.c
24+++ b/drivers/target/tcm_fc/tfc_sess.c
25@@ -355,11 +355,11 @@ static int ft_prli_locked(struct fc_rpor
26
27 tport = ft_tport_create(rdata->local_port);
28 if (!tport)
29- return 0; /* not a target for this local port */
30+ goto not_target; /* not a target for this local port */
31
32 acl = ft_acl_get(tport->tpg, rdata);
33 if (!acl)
34- return 0;
35+ goto not_target; /* no target for this remote */
36
37 if (!rspp)
38 goto fill;
39@@ -402,6 +402,12 @@ fill:
40 fcp_parm &= ~FCP_SPPF_RETRY;
41 spp->spp_params = htonl(fcp_parm | FCP_SPPF_TARG_FCN);
42 return FC_SPP_RESP_ACK;
43+
44+not_target:
45+ fcp_parm = ntohl(spp->spp_params);
46+ fcp_parm &= ~FCP_SPPF_TARG_FCN;
47+ spp->spp_params = htonl(fcp_parm);
48+ return 0;
49 }
50
51 /**