]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.drivers/ibmvfc_relogin_fix.patch
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / ibmvfc_relogin_fix.patch
CommitLineData
2cb7cef9
BS
1Subject: Fix rport relogin
2From: Brian King <brking@linux.vnet.ibm.com>
3References: 472645 - LTC51429
4
5The ibmvfc driver has a bug in its SCN handling. If it receives
6an ELS event such asn an N-Port SCN event or an unsolicited PLOGI,
7or any other SCN event which causes ibmvfc_reinit_host to be called,
8it is possible that we will call fc_remote_port_add for a target
9that already has an rport added, which can result in duplicate
10rports getting created for the same targets. Fix this by calling
11fc_remote_port_rolechg in this scenario instead to report any possible
12role change that may have occurred.
13
14Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
15Signed-off-by: Olaf Hering <olh@suse.de>
16---
17
18 drivers/scsi/ibmvscsi/ibmvfc.c | 12 +++++++++++-
19 1 file changed, 11 insertions(+), 1 deletion(-)
20
21--- a/drivers/scsi/ibmvscsi/ibmvfc.c
22+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
23@@ -3315,6 +3315,7 @@ static int ibmvfc_alloc_target(struct ib
24 return -ENOMEM;
25 }
26
27+ memset(tgt, 0, sizeof(*tgt));
28 tgt->scsi_id = scsi_id;
29 tgt->new_scsi_id = scsi_id;
30 tgt->vhost = vhost;
31@@ -3625,9 +3626,18 @@ static void ibmvfc_log_ae(struct ibmvfc_
32 static void ibmvfc_tgt_add_rport(struct ibmvfc_target *tgt)
33 {
34 struct ibmvfc_host *vhost = tgt->vhost;
35- struct fc_rport *rport;
36+ struct fc_rport *rport = tgt->rport;
37 unsigned long flags;
38
39+ if (rport) {
40+ tgt_dbg(tgt, "Setting rport roles\n");
41+ fc_remote_port_rolechg(rport, tgt->ids.roles);
42+ spin_lock_irqsave(vhost->host->host_lock, flags);
43+ ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_NONE);
44+ spin_unlock_irqrestore(vhost->host->host_lock, flags);
45+ return;
46+ }
47+
48 tgt_dbg(tgt, "Adding rport\n");
49 rport = fc_remote_port_add(vhost->host, 0, &tgt->ids);
50 spin_lock_irqsave(vhost->host->host_lock, flags);