Clear Devloss Callback Done flag in fc_remote_port_rolechg
James,
Ping... anything holding up inclusion of this patch ?
-- james s
Quoted 44 lines · James Smart
This patch fixes a bug where devloss is not called on
fc_hostteardown. The issue is seen if the LLDD usesrport_rolechgto 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 theFC_RPORT_DEVLOSS_CALLBK_DONEflag. 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 callsfc_remote_port_add, but does not indicate the "target" role for the rport - the create will clear the structure, but forgets to clearFC_RPORT_DEVLOSS_CALLBK_DONEflag (which is cleared if it's added with the target role). The secondary call, offc_remote_port_rolechgto 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_DONEflags to the list of those that are cleared upon reuse of the rport structure.Signed-off-by Alex Iannicelli<[email protected]>Signed-off-by James Smart<[email protected]>---
scsi_transport_fc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)diff -upNr
a/drivers/scsi/scsi_transport_fc.cb/drivers/scsi/scsi_transport_fc.cdrivers/scsi/scsi_transport_fc.c +2
-1@@ -3048,7 +3048,8 @@ fc_remote_port_rolechg(struct fc_rportspin_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 */