]>
Commit | Line | Data |
---|---|---|
cb01949f GKH |
1 | From edec8dfefa1f372b2dd8197da555352e76a10c03 Mon Sep 17 00:00:00 2001 |
2 | From: Mark Rustad <mark.d.rustad@intel.com> | |
3 | Date: Fri, 21 Dec 2012 10:58:19 -0800 | |
4 | Subject: tcm_fc: Do not report target role when target is not defined | |
5 | ||
6 | From: Mark Rustad <mark.d.rustad@intel.com> | |
7 | ||
8 | commit edec8dfefa1f372b2dd8197da555352e76a10c03 upstream. | |
9 | ||
10 | Clear the target role when no target is provided for | |
11 | the node performing a PRLI. | |
12 | ||
13 | Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> | |
14 | Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> | |
15 | Acked by Robert Love <robert.w.love@intel.com> | |
16 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | |
17 | Signed-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 | /** |