• Joe Eykholt's avatar
    [SCSI] libfc: send GPN_ID in reaction to single-port RSCNs. · 2ab7e1ec
    Joe Eykholt authored
    When an RSCN indicates changes to individual remote ports,
    don't blindly log them out and then back in.  Instead, determine
    whether they're still in the directory, by doing GPN_ID.
    
    If that is successful, call login, which will send ADISC and reverify,
    otherwise, call logoff.  Perhaps we should just delete the rport,
    not send LOGO, but it seems safer.
    
    Also, fix a possible issue where if a mix of records in the RSCN
    cause us to queue disc_ports for disc_single and then we decide
    to do full rediscovery, we leak memory for those disc_ports queued.
    
    So, go through the list of disc_ports even if doing full discovery.
    Free the disc_ports in any case.  If any of the disc_single() calls
    return error, do a full discovery.
    
    The ability to fill in GPN_ID requests was added to fc_ct_fill().
    For this, it needs the FC_ID to be passed in as an arg.
    The did parameter for fc_elsct_send() is used for that, since the
    actual D_DID will always be 0xfffffc for all CT requests so far.
    Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
    Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
    2ab7e1ec
fc_elsct.c 2.61 KB