• Roland Dreier's avatar
    qla2xxx: kill sessions/log out initiator on RSCN and port down events · b2032fd5
    Roland Dreier authored
    To fix some issues talking to ESX, this patch modifies the qla2xxx driver
    so that it never logs into remote ports.  This has the side effect of
    getting rid of the "rports" entirely, which means we never log out of
    initiators and never tear down sessions when an initiator goes away.
    
    This is mostly OK, except that we can run into trouble if we have
    initiator A assigned FC address X:Y:Z by the fabric talking to us, and
    then initiator A goes away.  Some time (could be a long time) later,
    initiator B comes along and also gets FC address X:Y:Z (which is
    available again, because initiator A is gone).  If initiator B starts
    talking to us, then we'll still have the session for initiator A, and
    since we look up incoming IO based on the FC address X:Y:Z, initiator B
    will end up using ACLs for initiator A.
    
    Fix this by:
    
     1. Handling RSCN events somewhat differently; instead of completely
        skipping the processing of fcports, we look through the list, and if
        an fcport disappears, we tell the target code the tear down the
        session and tell the HBA FW to release the N_Port handle.
    
     2. Handling "port down" events by flushing all of our sessions.  The
        firmware was already releasing the N_Port handle but we want the
        target code to drop all the sessions too.
    
    Cc: <stable@vger.kernel.org> # v3.18+
    Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
    Signed-off-by: default avatarAlexei Potashnik <alexei@purestorage.com>
    Acked-by: default avatarQuinn Tran <quinn.tran@qlogic.com>
    Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    b2032fd5
qla_target.c 160 KB