summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_transport_fc.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2011-11-03 19:10:40 +0400
committerJames Bottomley <JBottomley@Parallels.com>2012-01-16 09:37:01 +0400
commit0eecee413d3157bac4477362bfc4b907b4b2988b (patch)
tree76824cd2aa4e53a149255820f4f24977a8261b19 /drivers/scsi/scsi_transport_fc.c
parent410f02d813212eef1dedfcfd43460dd11a0ff707 (diff)
downloadlinux-0eecee413d3157bac4477362bfc4b907b4b2988b.tar.xz
[SCSI] scsi_transport_fc: Clear Devloss Callback Done flag in fc_remote_port_rolechg
This patch fixes a bug where devloss is not called on fc_host teardown. The issue is seen if the LLDD uses rport_rolechg to add the target role to an rport. When an rport goes away, the LLDD will call fc_remote_port_delete, which will start the devloss timer. If the timer expires, the transport will call the devloss callback and set the FC_RPORT_DEVLOSS_CALLBK_DONE flag. However, the rport structure is not deleted, it is retained to store the SCSI id mappings for the rport in case it comes back. In the scenario where it does come back, and the driver calls fc_remote_port_add, but does not indicate the "target" role for the rport - the create will clear the structure, but forgets to clear FC_RPORT_DEVLOSS_CALLBK_DONE flag (which is cleared if it's added with the target role). The secondary call, of fc_remote_port_rolechg to add the target role also does not clear the flag. Thus, the next time the rport goes away, the resulting devloss timer expiration will not call the driver callback as the flag is still set. This patch adds the FC_RPORT_DEVLOSS_CALLBK_DONE flags to the list of those that are cleared upon reuse of the rport structure. Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_fc.c')
-rw-r--r--drivers/scsi/scsi_transport_fc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 1b214910b714..f59d4a05ecd7 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -3048,7 +3048,8 @@ fc_remote_port_rolechg(struct fc_rport *rport, u32 roles)
spin_lock_irqsave(shost->host_lock, flags);
rport->flags &= ~(FC_RPORT_FAST_FAIL_TIMEDOUT |
- FC_RPORT_DEVLOSS_PENDING);
+ FC_RPORT_DEVLOSS_PENDING |
+ FC_RPORT_DEVLOSS_CALLBK_DONE);
spin_unlock_irqrestore(shost->host_lock, flags);
/* ensure any stgt delete functions are done */